• css中关于positive相应操作


    首先fixed 固定 它是不随着网页的滚动而变换位置的

    然后absolute   它的功能是根据父集元素来确定位置的  

    最后是relative    它的功能是根据其之前本来出现的位置进行相应的位置变动

    相应操作和对比如下:

    <!DOCTYPE html>
    <html>
        <head>
            <meta charset="UTF-8">
            <title></title>
            <style type="text/css">
                *{
                    margin: 0;
                    padding: 0;
                }
                #c-fixed{
                     200px;
                    height: 300px;
                    border: 1px solid red;
                    position: fixed;
                    bottom: 10px;
                    right: 10px;
                }
                #c-absolute{
                     200px;
                    height: 300px;
                    border: 1px solid red;
                    /*position: absolute;*/
                }
                #ceshi-1{
                     200px;
                    height: 300px;
                    background-color: black;
                    
                }
                #relative{
                     200px;
                    height: 300px;
                    border: 2px solid red;
                    position: relative;
                    top: 50px;
                    left: 50px;
                    
                }
                #margin{
                     200px;
                    height: 300px;
                    border: 1px solid green;
                    top: 20px;
                }
                #ceshi-2{
                     200px;
                    height: 300px;
                    background-color: #FF0000;
                    
                }
                #ceshi-3{
                     200px;
                    height: 300px;
                    background-color: aqua;
                }
                #w-ceshi{
                     400px;
                    height: 400px;
                    background-color: aliceblue;
                    position: absolute;
                    top: 30px;
                }    
                #n-ceshi{
                     200px;
                    height: 200px;
                    border: 2px solid greenyellow;
                    position: absolute;
                    top: 20px;
                }
                #c-index1{
                     200px;
                    height: 200px;
                    background-color: #FFA500;
                    position: absolute;
                    z-index: 1;
                }
                #c-index2{
                     400px;
                    height: 400px;
                    background-color: blueviolet;
                    position: absolute;
                    
                }
            </style>
        </head>
        <body>
            <div id="c-fixed">
                
            </div>
            <div id="c-absolute">
                
            </div>
            <div id="ceshi-1">
                
            </div>
            <div id="relative">
                
            </div>
            <div id="ceshi-2">
                
            </div>
            <div id="margin">
                
            </div>
            <div id="ceshi-3">
                
            </div>
            <div id="n-ceshi">
                <div id="w-ceshi">
                    
                </div>
            </div>
            <div id="c-index1">
                
            </div>
            <div id="c-index2">
                
            </div>
            
            <br /><br /><br /><br /><br /><br /><br />
            <br /><br /><br /><br /><br /><br /><br />
            <br /><br /><br /><br /><br /><br /><br />
            <br /><br /><br /><br /><br /><br /><br />
            <br /><br /><br /><br /><br /><br /><br />
        </body>
    </html>


    进行相应的操作之后得到的操作如下:

     

  • 相关阅读:
    hdu4355(三分求极值)
    Codeforces Round #107 (Div. 1) (快速求质因子、vector)
    2012哈工程ACM暑期集训图论专场(练习赛第7场)题解
    2012 MultiUniversity Training Contest 6
    Codeforces Beta Round #97 (Div. 2)
    Codeforces Round #134 (Div. 2) 并查集
    C++ Boost foreach
    Design : 如何设计View
    15个最优秀的酒店网页免费模板
    在C++中使用tr1实现functor/函数指针/成员函数指针
  • 原文地址:https://www.cnblogs.com/scw123/p/9460977.html
Copyright © 2020-2023  润新知