views:

66

answers:

7

Hey, I appear to have a CSS problem, regarding the spacing of my <div>s on my site.

If you point your browser to www.marioplanet.com you will see an odd space after my Apple-themed navigation bar.

I was wondering if anyone can help me identify why this spacing was added, and how I can eliminate it, as it's undesired.

Also, I believe it has something directly related to the nav bar, because without the nav bar, this is no spacing problem.

Thanks!

A: 

There is not much anyone can tell you without the page markup. If you post it I will see if I can help.

jason
+1  A: 

It is because of <a></a> present in <li id="gn-support"><a></a></li>

Sarfraz
Same as Paul's that works, to a degree, but it still leaves a tiny bit of space between the nav bar and the following div, and, it eliminates the other background portion of my PNG image.
BOSS
@BOSS: The remaining is coming from body background, try removing this from `body` css: `background-color:#666666`
Sarfraz
Well yes, I don't mind the color of the background, I just don't want that strip of background showing if you know what I mean. Changing that affects the entire background color.
BOSS
@BOSS: Whether you remove it or not, i just told you the reason of why it was happening :)
Sarfraz
:DBut, that isn't really my problem, is it?I'm trying to solve the problem of having the strip of the background separate the nav bar from my following <div>s. I'm trying to solve the problem of why that is even showing up.
BOSS
+1  A: 

That #globalheader DIV that contains the menu bar has 18px of vertical margin (top and bottom). So naturally what follows is displaced by 18px.

#globalheader {
height:37px;
margin:18px auto;
position:relative;
width:771px;
z-index:1;
}
Robusto
Great, that helps with spacing between my logo and the nav bar, but I still have that spacing between my nav bar and the rest of the page underneath it.
BOSS
as I mentioned below, do what Robusto says, but then adjust the width of the globalnav CSS listing...
alex
+1  A: 

You might want to remove the gn-ipad, gn-itunes and gn-support <li> elements from your html.

Paul Wagener
Hmm, that works in removing almost all of the spacing, yet, I can't seem to fathom why it removes the last empty background part of my PNG image, used for the nav bar.Could it possibly be that I could just turn those <li>s into one <li> and then format it properly to where it won't leave any space but it will also keep the background portion intact?
BOSS
+1  A: 

Get rid of the 18px portion of the margin in the globalheader item, then change the width of the globalnav item to 1000px:

globalnav {

margin:0; padding:0; width:1000px; }

alex
+1  A: 

Ok the problem has to do with you fixed width on:

#globalheader{
      width: 769px;  //this is too small and actually not needed.
}

The contained list (#globalnav) has a rendered width of 830px (it has some white space at the end didn't investigate to see where it came from. So if you remove the fixed width from globalheader and add a margin-left of 200px to #globalnav you will center it and get rid of the space.

Additionally if you can see why your list have a bunch of white space to the right of it expanding its size to 830px you can just do a margin-left and margin-right of auto and center the list inside the global header div.

Figured out where the extra space at the end of the ul is comming from list items gn-itunes and gn-support are both rendering with 103px in width. this is comming from the (#globalheader #globalnav LI A css rule) You can override the width in (#globalheader #globalnav li#gn-support A) as well as the (#globalheader #globalnav li#gn-itunes A) css rules and that should fix it as well without resorting to fix above.

antonlavey
+1  A: 

If you change the width of globalheader will work.

#globalheader { height:37px; margin:auto; position:relative; width:515px; z-index:1; }

If you want to add more navigation links later you will have to increase the width of globalheader.

mooneyscfc