当前位置: 移动技术网 > IT编程>网页制作>CSS > 2018.3.29 DIV位置调整代码

2018.3.29 DIV位置调整代码

2018年03月30日  | 移动技术网IT编程  | 我要评论

海南槟榔,谁是李世民txt,鸣金 site:317.ee

<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title></title>
        <style type="text/css">
            /*固定在页面某一位置*/
            #a{
                width: 20px;
                height: 20px;
                background-color: black;
                position: fixed;
                bottom: 10px;
                left: 10px;
            }
            /*相对于原位置所做的位移*/
            #b{
                width: 80px;
                height: 80px;
                background-color: red;
                position: relative;
                top: 60px;
                left: 60px;
            }
            /*相对于上一级界面做的位移*/
            #c{
                width: 20px;
                height: 20px;
                background-color: #8A2BE2;
                position: absolute;
                bottom: 30px;
                left: 30px;
            }
            /*浮动,向左*/
            #d{
                width: 20px;
                height: 20px;
                background-color: black;
                float: left;
            }
            /*浮动,向右*/
            #e{
                width: 20px;
                height: 20px;
                background-color: green;
                float: right;
            }
            /*清除上面div的格式影响*/
            .clear{
                clear: both;
            }
        </style>
    </head>
    <body>
        <div id="a">    
        </div>
        <div id="b">    
        </div>
        <div id="c">    
        </div>
        <div class="clear"></div>
        <div id="d">    
        </div>
        <div id="e">    
        </div>
        
    </body>
</html>

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网