2-14编程练习老师看下
来源:2-14 编程练习
慕先生1376233
2020-05-12 20:20:56
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Document</title>
<style>
.per{
width: 300px;
height: auto;
border:2px solid #aaa;
}
.li{
width: 100px;
height: 100px;
background: red;
margin: 5px;
float: left;
}
/*此处写代码*/
.clear{
clear:both;
}
clear:both;
</style>
</head>
<body>
<div class="per">
<div class="li"></div>
<div class="li"></div>
<!-- 此处写代码 -->
<div class="clear"></div>
</div>
</body>
</html>
1回答
虽然同学你说的让老师看下,但是我为了得到学分,还是厚着脸皮说。 你的这种清除浮动的方式符合题目要求。
相似问题