首页 > 其他 > 详细

使用 :after伪元素撑开 div

时间:2015-05-03 23:26:18      阅读:430      评论:0      收藏:0      [点我收藏+]

使用 :after伪元素撑开 div,

<html>
<head><style type="text/css">
    .clearfix:after {
        content: ".";
        display: block;
        height: 0;
        clear: both;
        visibility: hidden;
    }
</style>
</head>
<body>
    <div class="clearfix" style="padding:1px 1px 1px 1px; border: 1px solid red; width:200px;">
        <div style="float:left;width:80px;height:80px;border:1px solid blue;">TEST DIV</div>
        <div style="float:left;width:80px;height:80px;border:1px solid blue;">TEST DIV</div>
        <div style="float:left;width:80px;height:80px;border:1px solid blue;">TEST DIV</div>
        <div style="float:left;width:80px;height:80px;border:1px solid blue;">TEST DIV</div>
        <div style="float:left;width:80px;height:80px;border:1px solid blue;">TEST DIV</div>
    </div>
</body>
</html>

TEST DIV

TEST DIV

TEST DIV

使用 :after伪元素撑开 div

原文:http://www.cnblogs.com/npk19195global/p/4474914.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!