0
我需要幫助,解釋爲什麼邊緣應用於包裝盒底部的兩個盒子而不是頂部的大盒子。例如爲什麼有些divs的利潤率?
HTML:
<div id = "mainWrapperdiv">
<div id = "maindiv">
<div id = "moveablediv" >
<div id = "centerPointdiv"></div>
</div>
</div>
<div id = "animationsdiv" class = "controls"></div>
<div id = "optionsdiv" class = "controls"></div>
</div>
CSS:
*
{
padding: 0px;
margin: 0px;
}
div
{
border: 1px solid;
}
#mainWrapperdiv
{
width: 1000px;
display: block;
margin-left: auto;
margin-right: auto;
}
/**** CSS approach to forcing the main containter div to include it's floated elements *****/
#mainWrapperdiv:after
{
content: ".";
display: block;
clear: both;
height: 0px;
visibility: hidden;
}
/***** end main containter div including floated elements **********************************/
#maindiv
{
width: 850px;
height: 500px;
border: 5px solid;
margin: 30px 0px 30px 70px;
float: left;
}
div.controls
{
width: 400px;
height: 200px;
border: 5px solid;
margin: 20px 20px 10px 70px;
float: left;
}
所以是所申請的底框的邊緣,當頂部的大箱子忽略了左,右頁邊距?
我不知道你做了什麼。我假設你的抱怨是右邊的底部框與中心框不一致。那是對的嗎? – Hemlock 2011-01-08 02:21:46