4 Column Position absolute layout

陌路散爱 提交于 2019-12-24 15:06:20

问题


I have a layout setup which can be view here: http://jsfiddle.net/Pn3ts/

It all works fine but i need to set a max/min width around the whole lot.

So i assume to do this i'd add in position: relative; onto the .row class. However if i do this the background of each .col seems to collapse. (see here: http://jsfiddle.net/YDBYK/)

How would i work this?


回答1:


Give the html, body, and .row a height of 100% and it'll work.

html, body {
    height: 100%;
}

.row {
    position: relative; 
    width:100%; 
    height: 100%;
    margin: 0; 
    max-width: 400px; 
    min-width: 300px;
}

jsFiddle: http://jsfiddle.net/YDBYK/1/



来源:https://stackoverflow.com/questions/11307317/4-column-position-absolute-layout

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