首页 新闻 会员 周边

请问为什么我这样设置不能处理崩坏?

0
[已解决问题] 解决于 2017-10-20 10:04

<!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>

蟲仔在路上的主页 蟲仔在路上 | 菜鸟二级 | 园豆:202
提问于:2017-10-04 15:05
< >
分享
最佳答案
0
  1. 解决塌陷问题你可以用:
  2. 父级添加伪类after

     

    Clearafter{

    content””;     

    display:blok;      

       clear: both;

 }

 

 

  1. 父级添加伪类after(推选使用)

     

    Clearafter{

    content””;     clear类后面添加内容为空

    display:blok;      吧添加的内容

clear: both;  清除俩边的浮动

奖励园豆:5
网者 | 菜鸟二级 |园豆:209 | 2017-10-05 12:47
其他回答(1)
0

给父级来个overflow:hidden

shinylinky | 园豆:276 (菜鸟二级) | 2017-10-19 17:03
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册