知识点

固定定位:

参照物:浏览器可视区

作用:导航栏

图片

![图片上传失败(1)]

代码

<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title></title>
        
        <style type="text/css">
            #box{
                height: 60px;
                width: 100%;
                background-color: rosybrown;
                /* 固定定位 */
                position: fixed;
                left: 0;
                bottom: 0;
            }
            #box2{
                height: 2000px;
                border: solid 1px red;
                
            }
            
        </style>
    </head>
    <body>
        <div id="box2">
            
        </div>
        <div id="box">
            
        </div>
        
    </body>
</html>
最后修改:2019 年 11 月 02 日
如果觉得我的文章对你有用,请随意赞赏