Div with a width of 100%, next to a fixed width one

余生长醉 提交于 2019-12-06 13:23:07

Basically I have a side navigation (.menu-vertical) that is 230px wide, and a div next to it (.mainContent) that I would like to (padding aside!) fill the rest of the screen.

..

the basis of the site is in place with a .container div, and the .menu-vertical (fixed) and .mainContent (fluid, 100%) divs inside.

From what I understand, you're looking for this: http://jsfiddle.net/thirtydot/wv42t/

CSS:

.container {
    border: 3px solid #666;
    overflow: hidden
}
.menu-vertical {
    width: 230px;
    float: left;
    padding: 10px;
    border: 2px solid #f0f
}
.mainContent {
    overflow: hidden;
    padding: 30px;
    border: 2px solid #00f
}

HTML:

<div class="container">
    <div class="menu-vertical">menu-vertical</div>
    <div class="mainContent">mainContent</div>
</div>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!