Link to home
Start Free TrialLog in
Avatar of tolvor
tolvor

asked on

Removing white-space at top of webpage

The code is below.  When using IE6 this page displays correctly with the red content block hard against the bottom of the address bar.  When displaying the same page in FireFox 2.0 the page has a 9px white border at top.  All available research on this says setting the top margin to 0 should clear this up, tried it, doesn't help.  Setting a negative top margin doesn't work because then FF2 display correctly, but IE6 the text is cutting off at the top.

A solution requires that the page displays flush at the top in both FF2 and IE6.


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
<title>Remove the white space at top in Firefox 2.0</title>
	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
 
<style type="text/css">
 
html, body {margin:0; padding:0; left:0; margin-top:0;padding-top:0;}
 
p, h1 {top-margin: 0; padding: 0;}
 
#content{  
  background-color: #f00;
  margin-top: 0px;
  border-top: 0px;
  font-size: 9px;
position: relative; vertical-align:top;
  height: 90px;
}
 
</style>
</head>
 
<body>
  <div id="content">
    <p>Testing 1 2 3</p>
  </div>
</body>
</html>

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Roonaan
Roonaan
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial