<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<style type="text/css">
.content{width:100%;
height:auto;
border:1px solid #ccc;
padding:10px;
}
.part1{width: 100%;
float:left;
clear: both;
}
.test1,.test2,.test3
{border:1px solid #ccc;
width:200px;
height:auto;
float:left;
margin: 10px;
}
</style>
</head>
<body>
<div class="content">
<div class="part1">
<div class="test1">
<img src="http://climg.mukewang.com/590fe9770001e63102400135.jpg" width="200px" height="100px">
<p>欢迎来到慕课网学习新知识!</p>
</div>
<div class="test2">
<img src="http://climg.mukewang.com/590fe97d00011bda02400135.jpg">
<p>欢迎来到慕课网学习新知识!</p>
</div>
<div class="test3">
<img src="http://climg.mukewang.com/590fe982000150ba02400135.jpg">
<p>欢迎来到慕课网学习新知识!</p>
</div>
</div>
</div>
</body>
</html>
父级添加伪类after
Clear:after{
content:””;
display:blok;
clear: both;
}
父级添加伪类after(推选使用)
Clear:after{
content:””; 在clear类后面添加内容为空
display:blok; 吧添加的内容
clear: both; 清除俩边的浮动
给父级来个overflow:hidden