首页 > Web开发 > 详细

第二周-3:CSS核心技术

时间:2016-08-27 23:19:28      阅读:214      评论:0      收藏:0      [点我收藏+]

(1)神奇的float;

 

技术分享技术分享技术分享

<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <style type="text/css">
        div{
            height: 100px;
            float: left;
        }
        .container{
            border:1px solid blue;
            height: 300px;
            width: 250px;
            background-color: antiquewhite;
        }
        .first{
            background: red;
        }
        .second{
            background: cyan;
        }
        .third{
            background: chartreuse;
        }
        .n{
            background: darkorchid;
        }
    </style>
</head>
<body>
    <div class="container">
        <div class="first">
            第一个div
        </div>
        <div class="second">
            第二个div
        </div>
        <div class="third">
            第三个div
        </div>
        <div class="n">
            第n个div
        </div>
    </div>
</body>
</html>

(2)定位position;

 技术分享

<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <style type="text/css">
        div{
            height: 100px;
            width: 100px;
        }
        .rel{
            background: red;
            display: inline-block;
        }
        .abs{
            background: green;
            display: inline-block;
        }
    </style>
</head>
<body>
    <div class="rel"></div>
    <div class="abs"></div>
</body>
</html>

技术分享技术分享技术分享技术分享技术分享

 

第二周-3:CSS核心技术

原文:http://www.cnblogs.com/zzjeny/p/5813895.html

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