题解 | #浮动和清除浮动#
浮动和清除浮动
https://www.nowcoder.com/practice/88bcbaee954349f5a8810bfa94ee61a8
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<style>
.wrap:after, .wrap:before {
/*补全代码*/
content:'';
display: table;
}
.wrap:after{
clear:both;
}
.left {
width: 100px;
height: 100px;
/*补全代码*/
float: left;
}
.right {
width: 100px;
height: 100px;
/*补全代码*/
float: left;
}
</style>
</head>
<body>
<div class='wrap'>
<div class='left'></div>
<div class='right'></div>
</div>
<script type="text/javascript">
/* 填写JavaScript */
</script>
</body>
</html>
