another HTML/CSS layout challenge

后端 未结 3 1213
灰色年华
灰色年华 2020-12-21 09:28

I\'ve been trying to figure out a solution to this problem but haven\'t been 100% successful, just pseudo successful. The layout I\'m looking for is one such that there is a

3条回答
  •  臣服心动
    2020-12-21 09:53

    I came up with this:

    http://jsfiddle.net/bKsad/

    • Due to the use of box-sizing: border-box, it won't work in IE7 and older.
    • It should work in all modern browsers.
    • You could replace #padding-bottom with #content:after. Beware IE8 though, I couldn't quite get it working.

    CSS:

    html, body {
        margin: 0;
        padding: 0;
        height: 100%;
    }
    body {
        background: url(http://dummyimage.com/100x100/f0f/fff);
    }
    
    #wrapper {
        margin: 0 auto;
        width: 300px;
        height: 100%;
        padding: 15px 0;
    
        -moz-box-sizing: border-box;
        -webkit-box-sizing: border-box;
        box-sizing: border-box;
    }
    #content {
        background-color: #C9E6FF;
        min-height: 100%;
    }
    #padding-bottom {
        height: 15px;
    }
    

    HTML:

    some content

    some content

    some content

提交回复
热议问题