为什么fixed后,DIV7消失了,怎么显示出来?

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
        "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <title></title>
    <style type="text/css">
        #div1{
            width: 200px;
            height: 200px;
            background-color: #4061f5;

        }
        #div2{
            width: 300px;
            height: 300px;
            background-color: #eff57b;

        }
        #div3{
            width: 200px;
            height:300px;
            background-color: #f52e16;


        }
        #div4{
            width: 100px;
            height: 100px;
            background-color: #70f5b1;

        }
        #div5{
            width: 100px;
            height: 100px;
            background-color: #f595a6;

        }
        #div6{
            width: 100px;
            height: 100px;
            background-color: #c500f5;

        }
        #div7{
            border: 1px solid saddlebrown;
            width: 50px;
            height: 50px;
            background-color: #f5783a;
            position: fixed;

        }
        div{
            margin:0;
            padding: 0;
        }
    </style>
</head>
<body>
<div id="div1">1</div>
<div id="div2">2
    <div id="div4">4</div>
    <div id="div5">5</div>
    <div id="div6">6</div>
</div>
<div id="div3">3</div>
<div id="div7"></div>
</body>
</html>


慕粉15181338995
浏览 3039回答 3
3回答

竹马君

少了7了

echo_kinchao

fixed是相对于浏览器来说的  如果没有就是你的内容没有撑开元素
打开App,查看更多内容
随时随地看视频慕课网APP