faqts : Computers : Internet : Web : CSS

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

7 of 18 people (39%) answered Yes
Recently 1 of 10 people (10%) answered Yes

Entry

How can I force a DIV to be the height of the page (not necessarily the window) via CSS?

Dec 5th, 2001 14:04
Joćo Luiz Piza, Jason Fleshman,


Use the following sample to fill the entire window with a yellow div. 
If you remove the margin and the padding properties of the body 
selector, you should see the body's red color around the div.

This works fine with IE 5.5. Other versions may require you to put some 
real content inside the div, even if it is a simple  .

<html>
<head>
	<title>Yellow Screen</title>
	<meta http-equiv="Content-Type" content="text/html; charset=iso-
8859-1">
<style>
  body {
    background-color: #f00;
    margin: 0;
    padding: 0;
  }
</style>
</head>
<body>
	<div id="emptyMain" name="emptyMain" style="margin:0; 
padding:0; background-color:#ff0; height:100%;"></div>
</body>
</html>