zoukankan      html  css  js  c++  java
  • 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>


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

     

  • 相关阅读:
    ActiveX版本升级步骤
    转 .NET 2.0中串口通讯类SerialPort用法整理
    解决“请求的名称有效并且在数据库中找到,但是它没有相关的正确的数据来被解析”
    Padding is invalid and cannot be removed 解决方法
    【转】Umbraco 4 安装 中文教程
    在windows 2008 装oracle 10g
    使用Synctoy进行数据同步
    windows server 2008 多用户远程登录设置
    你好,博客园!
    使Ruby在OS X的控制台输出中使用颜色
  • 原文地址:https://www.cnblogs.com/scw123/p/9460977.html
Copyright © 2011-2022 走看看