题目
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道考试原题与详细解析,现在登录,立即获得答案。
类似问题
Question at position 11 In CSS, what is the difference between padding and margins?In CSS, what is the difference between padding and margins?Padding is the space between elements, and margins are used to create space within an element.Margins are used to change the color of an element's border, whereas padding is for setting the width of the border.Margins are the inner spacing of text within an element, while padding is the outer spacing around the element.Padding is the space inside an element's border, while margins are the space outside an element's border.There is no difference; padding and margins are interchangeable terms in CSS.
In a consumer society, many adults channel creativity into buying things
Economic stress and unpredictable times have resulted in a booming industry for self-help products
People born without creativity never can develop it
更多留学生实用工具
希望你的学习变得更简单
加入我们,立即解锁 海量真题 与 独家解析,让复习快人一步!