摘要:
CSS中的浮动CSS中的浮动*{padding:0px;margin: 0px;}/*浏览器自带边距清零*/
ul li{list-style: none;width: 100px; height: 40px; line-height: 40px; text-align: center; background-color: #ccc;margin: 0px 1px;float: left;}
.box1{width: 100px; height: 40px; background-color: pink; line-height:40px; text-align:center; float: left; margin: 0px 2px;}
.clear{clear: both;}/*清除浮动*/
.box2{width: 100px; height: 40px; background-color: pink; line-height:40px; text-align:center; float: right; border: 1px solid #ccc; border-radius: 10px; margin: 0px 5px;}
.box2:hover{background-color: red;}
批改老师:西门大官人批改时间:2019-04-22 10:48:28
老师总结:思考一下,元素浮动后,如何清除浮动?为什么要清除浮动