944,033 Members | Top Members by Rank

Ad:
Sep 30th, 2009
-1

CSS mozilla problems

Expand Post »
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:
HTML and CSS Syntax (Toggle Plain Text)
  1. body,html{margin:0;
  2. padding:0;
  3. width:100%}
HTML and CSS Syntax (Toggle Plain Text)
  1. #head{ width:100%;
  2. height:auto;
  3. padding:0;
  4. margin:0;
  5. background:#09F}
HTML:
HTML and CSS Syntax (Toggle Plain Text)
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  5. <link type="text/css" rel="stylesheet" href="styles/general.css" />
  6. <title>PSPF Intranet system</title>
  7. </head>
  8.  
  9. <body>
  10. <div id="head">
  11. <div id="menubar">
  12. <ul>
  13. <li>Item1</li>
  14. <li>Item2</li>
  15. <li>Item3</li>
  16. <li>Item3</li>
  17. </ul>
  18. </div>
  19. </div>
Thanking you in advance
Last edited by alimoe; Sep 30th, 2009 at 5:35 am.
Similar Threads
Reputation Points: 10
Solved Threads: 3
Junior Poster in Training
alimoe is offline Offline
82 posts
since Jun 2008
Sep 30th, 2009
0

Re: CSS mozilla problems

  • Item1
  • Item2
  • Item3
  • Item3
try styling unordered lists
not sure, but, the default style for lists has a whitespace between li elements
css Syntax (Toggle Plain Text)
  1. ul {margin:0; padding:0;}
  2. ul li {margin:0; padding:0;}
Last edited by almostbob; Sep 30th, 2009 at 8:46 am.
Reputation Points: 562
Solved Threads: 368
Posting Maven
almostbob is offline Offline
2,970 posts
since Jan 2009
Oct 1st, 2009
0

Re: CSS mozilla problems

its not just the list tag, its any tag i add.
Reputation Points: 10
Solved Threads: 3
Junior Poster in Training
alimoe is offline Offline
82 posts
since Jun 2008
Oct 1st, 2009
0

Re: CSS mozilla problems

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

css Syntax (Toggle Plain Text)
  1. 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
Reputation Points: 16
Solved Threads: 16
Light Poster
Traevel is offline Offline
38 posts
since May 2009
Oct 2nd, 2009
0

Re: CSS mozilla problems

still... it works fine with IE but not with firefox
Reputation Points: 10
Solved Threads: 3
Junior Poster in Training
alimoe is offline Offline
82 posts
since Jun 2008
Oct 2nd, 2009
0

Re: CSS mozilla problems

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


Thank you all.
Reputation Points: 10
Solved Threads: 3
Junior Poster in Training
alimoe is offline Offline
82 posts
since Jun 2008
Oct 2nd, 2009
0

Re: CSS mozilla problems

try to add specifically
margin-top: 0px; in the body css
Reputation Points: 10
Solved Threads: 0
Newbie Poster
cleanserevoluti is offline Offline
1 posts
since Oct 2009

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in HTML and CSS Forum Timeline: Javascript onHover effect ?
Next Thread in HTML and CSS Forum Timeline: where to put background in this code





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC