Make body have 100% of the browser height I want to make body have 100% of the browser height. Can I do that using CSS? I tried setting height: 100%, but it doesn't work. I want to set a background color for a page to fill the entire browser window, but if the page has little content I get a ugly white bar at the bottom. Answer: Try setting the height of the html element to 100% as well. html, body { height: 100%; }
undefined
Make div 100% height of browser window 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. Best Answer: There are a couple of relatively new CSS3 measurement units called: Viewport-Percentage (or Viewport-Relative) Lengths What are Viewport-Percentage Lengths? From the linked W3 Candidate Recommendation above: