题目
题目

4510_COMP_SCI_X_0019 Quiz 2

多项选择题

Which of the following CSS blocks results in this blue div:

选项
A.div { width: 200px; height: 150px; padding: 50px; margin: 50px; border: 2px solid blue; background-color: CornflowerBlue; }
B.div { width: 150px; height: 100px; padding: 50px; margin: 50px; border: 2px solid blue; background-color: CornflowerBlue; }
C.div { width: 100px; height: 50px; padding: 50px; margin: 50px; border: 2px solid blue; background-color: CornflowerBlue; box-sizing: border-box }
D.div { width: 96px; height: 46px; padding: 50px; margin: 50px; border: 2px solid blue; background-color: CornflowerBlue; }
E.div { width: 200px; height: 150px; padding: 50px; margin: 50px; border: 2px solid blue; background-color: CornflowerBlue; box-sizing: border-box }
F.div { width: 150px; height: 100px; padding: 50px; margin: 50px; border: 2px solid blue; background-color: CornflowerBlue; box-sizing: border-box }
题目图片
查看解析

查看解析

标准答案
Please login to view
思路分析
We start by restating the task: identify which CSS block produces a blue div matching the given dimensions and styling. Option 1 declares: div { width: 200px; height: 150px; padding: 50px; margin: 50px; border: 2px solid blue; background-color: CornflowerBlue; } With the default box-sizing: content-box, padding adds to the width and height. The total rendered box would be: outer width = 200px + 2*50px padding + 2*2px border = 200 + 100 + 4 = 304px, outer height = 150px + 2*50px padding + 2*2px border = 150 + 100 + 4 = 254px. That does not match the target 200x150 plus padding ap......Login to view full explanation

登录即可查看完整答案

我们收录了全球超50000道考试原题与详细解析,现在登录,立即获得答案。

更多留学生实用工具

加入我们,立即解锁 海量真题独家解析,让复习快人一步!