ridermansb
ridermansb

Reputation: 11059

Removing the edge margin of an element "li"

I am with this HTML and it all elements li.gradient-top seem to have an edge right

I've checked on several debugger tools but do not know why he's putting the margin between an li element and another li.

How to remove this margin?

Upvotes: 2

Views: 355

Answers (1)

gilly3
gilly3

Reputation: 91497

That is not margin but a space character. Since these are inline elements, whitespace is displayed between them if it exists in the markup. Remove the whitespace from the html. Eg:

    <li>...</li>
    <li>...</li>

Becomes:

    <li>...</li><li>...</li>

If you don't want to change the markup, you can try applying float: left to the <li> elements.

Upvotes: 7

Related Questions