Solved

Removing white-space at top of webpage

Posted on 2008-06-21
1
12,671 Views
Last Modified: 2012-08-14
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

0
Comment
Question by:tolvor
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 49

Accepted Solution

by:
Roonaan earned 250 total points
ID: 21838880
replace top-margin with margin-top in p, h1
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question