• 微信公众号:美女很有趣。 工作之余,放松一下,关注即送10G+美女照片!

css-19.float

开发技术 开发技术 4小时前 2次浏览
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>float</title>
<style>
.father{
border: 1px solid red;

}
.father:after{
content: ' ';
display: block;
clear: both;
}
.div1{
/*float: right;*/
display: inline-block;
float: left;

}
.div2{
display: inline-block;

}
.div3{
display: inline-block;

}
.div4{
display: inline-block;

}

</style>

</head>
<body>
<div class="father">
<div class="div1"><img src="images/a.jpg" alt=""></div>
<div class="div2"><img src="images/b.jpg" alt=""></div>
<div class="div3"><img src="images/c.jpg" alt=""></div>
<div class="div4">你好世界</div>
<div class="clear"></div>
</div>
</body>
</html>

程序员灯塔
转载请注明原文链接:css-19.float
喜欢 (0)