码迷,mamicode.com
首页 > 其他好文 > 详细

fixed定位对其

时间:2017-02-06 00:18:45      阅读:203      评论:0      收藏:0      [点我收藏+]

标签:doctype   meta   type   text   margin   height   z-index   宽度   set   

fixed定位

<!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>

 

11111111111111111111
 

fixed定位对其

标签:doctype   meta   type   text   margin   height   z-index   宽度   set   

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

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