<h2>box1에만 float:left를 적용</h2>
<div class="wrap">
<div class="one float">box1</div>
<div class="two">box2</div>
</div>
<h2>box1, box2 둘 다 float:left를 적용</h2>
<div class="wrap">
<div class="one float">box1</div>
<div class="two float">box2</div>
</div>
.wrap{
border: 3px solid #999;
font-size: 30px;
margin-bottom: 30px;
}
.one{
margin: 5px;
background-color: lightpink;
}
.two{
margin: 5px;
background-color: lightblue;
}
.float{
float: left;
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.