954,598 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

CSS mozilla problems

hi,
I have a header on my website. Whenever i add a tag in side the header an annoying white space forms above it. This happens only in firefox:

CSS:[INDENT]

body,html{margin:0;
           padding:0;
           width:100%}


[/INDENT][INDENT]

#head{ width:100%;
        height:auto;
		padding:0;
		margin:0;
		background:#09F}


[/INDENT]
HTML:[INDENT]

<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link type="text/css" rel="stylesheet" href="styles/general.css" />
<title>PSPF Intranet system</title>
</head>

<body>
          <div id="head">
             <div id="menubar">
                <ul>
                  <li>Item1</li>
                  <li>Item2</li>
                  <li>Item3</li>
                  <li>Item3</li>
                 </ul>
                </div>
           </div>


[/INDENT]
Thanking you in advance

alimoe
Junior Poster in Training
82 posts since Jun 2008
Reputation Points: 10
Solved Threads: 3
 
  • Item1
  • Item2
  • Item3
  • Item3

try styling unordered lists
not sure, but, the default style for lists has a whitespace between li elements

ul {margin:0; padding:0;}
ul li {margin:0; padding:0;}
almostbob
Posting Sensei
3,149 posts since Jan 2009
Reputation Points: 571
Solved Threads: 376
 

its not just the list tag, its any tag i add.

alimoe
Junior Poster in Training
82 posts since Jun 2008
Reputation Points: 10
Solved Threads: 3
 

Would those tags happen to be in between the <ul> tags? In that case they would still create a whitespace above your header. The suggestions almostbob made should help in removing all the margins for ul and li tags, and they certainly remove the whitespace in Firefox with the code you provided. If you're only interested in removing the top margin, you could also use

ul{margin-top:0;}


If the whitespace keeps returning with different tags just add the line tag{margin-top:0;} or tag{margin:0;} for the specific tag(s) as well.

Hope that helps, good luck.

Traevel

Traevel
Light Poster
38 posts since May 2009
Reputation Points: 16
Solved Threads: 16
 

still... it works fine with IE but not with firefox

alimoe
Junior Poster in Training
82 posts since Jun 2008
Reputation Points: 10
Solved Threads: 3
 

solved: I just float some divs... it works great.


Thank you all.

alimoe
Junior Poster in Training
82 posts since Jun 2008
Reputation Points: 10
Solved Threads: 3
 

try to add specifically
margin-top: 0px; in the body css

cleanserevoluti
Newbie Poster
1 post since Oct 2009
Reputation Points: 10
Solved Threads: 0
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You