float属性
注:浮动元素产生了浮动流
所有产生浮动流的元素,块级元素看不到它们;
产生了bfc的元素和文本类属性(inline)的元素以及文本都能看到浮动元素。
<style>
.wrapper{
width:300px;
height: 300px;
border: 1px solid black;
}
.content{
width:100px;
height: 100px;
background-color: black;
color: #fff;
float: left;
opacity: 0.25;
}
.two{
width:100px;
height: 100px;
background-color: yellow;
clear: both;
}
</style>
<body>
<div class="wrapper">
<div class="content">1</div>
<div class="content">2</div>
<div class="content">3</div>
<div class="two">123</div>
</div>
</body>