</div> <div class="box4"><div class="box2"> <h1>ボックス2</h1> </div> <div class="box3"> <p>box3box3box3box3box3box3box3box3box3box3box3box3box3box3box3box3b</p> </div>
</div> </body> </html><h1>ボックス</h1>
というhtmlに対して
body{
margin: 0;
}
.boxA:after{
content:"aiue";
display: block;
clear: both;
}
.box1{
background-color: red;
height:200px;
}
.box2{
background-color: blue;
float: left;
height:200px;
width:50%;
}
.box3{
background-color: gray;
float:none;
height:200px;
width:50%;
}
.box4{
background-color: green;
height:200px;
}
というCSSにすると上に余白が出来てしまうのですがなぜでしょうか?
初心者です!
宜しくお願い申し上げます。

バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2015/12/01 05:30