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

CSS相对定位

时间:2017-02-06 00:03:56      阅读:239      评论:0      收藏:0      [点我收藏+]

标签:body   head   fixed   doc   dex   htm   order   idt   auto   

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>fixed</title>
    <style type="text/css">
    .div1{
        position: fixed;
        left: 100%;
        top: 50%;
        margin-left: -200px;/*向左移动一个DIV的宽度就可以显示了的*/
        margin-top: -100px;
        width: 200px;
        height: 200px;
        border: 1px solid blue;
        background: pink;
        z-index: 999;
    }
    .div2{
        margin: 0 auto;
        width: 500px;
        height: 1000px;
        border: 1px solid blue;
        background: silver;

    }
    </style>
</head>
<body>
    <div class="div1">
        11111111111111111111
    </div>
    <div class="div2"></div>
</body>
</html>

CSS相对定位

标签:body   head   fixed   doc   dex   htm   order   idt   auto   

原文地址:http://www.cnblogs.com/qianjilou/p/6368772.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!