Joel 0

Why does the navigation have a margin?

  • it didnt work. i added: #nav ul{ margin:0px; } Check my code please Joel about 7 years ago
  • i just saw that it's okay in IE, but the margin problem is in Firefox Joel about 7 years ago
  • why are the text now messed up? Joel about 7 years ago
  • there is no style rule in the #nav ul {} selector, there must be a typo in your code ;) it still has margin applied. Do you use Firebug? I think it's element and CSS inspector features would help you to spot these kinds of problems easily :) danwellman about 7 years ago

5 answers

3
points
This was chosen as the best answer

try:

    #nav ul{
        margin: 0;
        padding: 0;
    }
Answered about 7 years ago by Tony Crockford
1
point

Instead of just resetting your navigation's margin & padding, I recommend using a reset stylesheet. This removes the default css properties that various browsers apply to certain page elements, so to ensure your design stays continuous you should remove these and start from a level playing field in all browsers.

Try Eric Meyer's Reset Stylesheet

Answered about 7 years ago by Russell Bishop
  • the downside to a reset style sheet for novices is that they need to add new defaults for all elements. I generally use a reduced reset.css, as content list styling is something often overlooked. Tony Crockford about 7 years ago
danwellman 5600
0
points

The <ul> has a margin which is applied by browsers by default (as it's a block-level element). Set it to margin:0 to remove it

Answered about 7 years ago by danwellman
Emily G 620
0
points

Do you mean on the left? <ul> has a default padding. Set padding:0 to remove it.

Or do you mean the margin on the top? Float your div nav left to move it up to the top.

#nav {float:left;}

Answered about 7 years ago by Emily G
0
points

Remember when resetting styling for lists it is necessary to control both margin and padding. This is because some browsers use margin to indent lists and others use padding. (Both are legitimate and there is no reason to unify, which would break some legacy sites if they did).

Answered about 7 years ago by Richard Grevers