题解 | #浮动和清除浮动#

浮动和清除浮动

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>

全部评论

相关推荐

头像
04-29 10:53
已编辑
东北大学 自动化类
点赞 评论 收藏
转发
点赞 收藏 评论
分享
牛客网
牛客企业服务