首页 > Web开发 > 详细

css2

时间:2016-05-14 15:27:43      阅读:240      评论:0      收藏:0      [点我收藏+]
CSS 实现div宽度根据内容自适应
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>脚本之家</title>
    <style type="text/css">
        .parent{
            width:400px;
            height:400px;
            border:1px solid red;
        }
        .children{
            border:1px solid blue;
            height:50px;
            display:inline-block;    /*这三行*/
            *display:inline;      /*  css hack 兼容ie6      */
            *zoom:1;             
        }
    </style>
</head>
<body>
<div class="parent">
    <div class="children">CSS 实现div宽度根据内容自适应</div>
</div>
</body>
</html>

clear写法?

.clear { zoom:1; }
.clear:after { content:‘‘; display:block; clear:both; }

 

css2

原文:http://www.cnblogs.com/gyz418/p/5492495.html

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