开发者

Removing the edge margin of an element "li"

开发者 https://www.devze.com 2023-03-13 09:17 出处:网络
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 elem开发者_运维技

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 elem开发者_运维技巧ent and another li.

How to remove this margin?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号