小编Mit*_*tch的帖子

填充div的空间

我想要一个元素来填充父div的剩余空间.我已设法做到这一点,你可以在这里看到"链接删除"但填充div(右)位于左div下方.我基本上希望正确的div从左div完成的地方开始.

希望这是有道理的.

    <html>
    <head>
    <title></title>
    <style type="text/css">
    #left {
        float:left;
        width:180px;
        background-color:#ff0000;
        height:20px;
    }
    #right {
        width: 100%;
        background-color:#00FF00;
        height:30px;
    }
    </style>
    </head>

    <body>
    <div>
    <div id="left">Nav</div>
    <div id="right">This is the space I need to fill but not go underneath the nav div</div>
    </div>
    </body>
    </html>
Run Code Online (Sandbox Code Playgroud)

html css width fill

6
推荐指数
1
解决办法
1642
查看次数

标签 统计

css ×1

fill ×1

html ×1

width ×1