叼花硬汉 2009-10-15 21:18 采纳率: 0%
浏览 646

设置浏览器窗口的 div 为100%

I have a layout with two columns - a left div and a right div.

The right div has a grey background-color, and I need it to expand vertically depending on the height of the user's browser window. Right now, the background-color ends at the last piece of content in that div.

I've tried height:100%, min-height:100%; etc.

转载于:https://stackoverflow.com/questions/1575141/make-a-div-100-height-of-the-browser-window

  • 写回答

30条回答 默认 最新

  • MAO-EYE 2009-10-15 21:31
    关注

    If you’re able to absolutely position your elements,

    position: absolute;
    top: 0;
    bottom: 0;
    

    would do it.

    评论

报告相同问题?