码迷,mamicode.com
首页 > Web开发 > 详细

css2

时间:2016-05-14 15:28:51      阅读:152      评论: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
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!