user417669
user417669

Reputation: 178

padding and margin for CSS <li> simply NOT WORKING

I am working on this site, and I have a pretty large .css document. For some reason I cant get these list items to have a padding or margin of anything other than 0px.

I have no idea where it might be inheriting this from, and why me writing

{
margin: 5px;
padding: 5px;
}

does nothing!

Here is the site, im referring to the element in a really ugly, bright green, with the class of ".wiffleMainNav ul li."

The CSS rule is at the bottom of the linked styles sheet.

Thanks so much!

-Aza

Upvotes: 2

Views: 6988

Answers (3)

deep rock
deep rock

Reputation: 34

Your css uses this:

.wiffleMainNav ul li { display: block; float: left; padding: 5px, margin: 0px 2px; background: green; }

Note the Comma after "padding: 5px" instead of semi-colon.

Upvotes: 0

Marko
Marko

Reputation: 72222

You have a comma in your definition.

Change this

.wiffleMainNav ul li {
    display: block;
    float: left;
    padding: 5px, /* PROBLEM! :) */
    margin: 0px 2px;
    background: green;
}

To this

.wiffleMainNav ul li {
    display: block;
    float: left;
    padding: 5px; /* FIXED */
    margin: 0px 2px;
    background: green;
}

Upvotes: 6

takteek
takteek

Reputation: 7110

You have a comma at the end of the padding line:

padding: 5px,
margin: 0px 2px;

Upvotes: 4

Related Questions