4 Column Position absolute layout

2019-08-01 04:24发布

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条回答
唯我独甜
2楼-- · 2019-08-01 04:42

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/

查看更多
登录 后发表回答