The SitePoint Forums have moved.

You can now find them here.
This forum is now closed to new posts, but you can browse existing content.
You can find out more information about the move and how to open a new account (if necessary) here.
If you get stuck you can get support by emailing forums@sitepoint.com

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

In the attached image all yellow borders for navigation bar is <a> and purple is <li>. See the problem with first navigation item, when spread over two lines its creates problem. Let me know if their is any solution to this.

Anchors are inline elements and when you apply padding to inline elements it adds the padding to the inline element only That is to say that the padding gets stuck to the inline element itself and not the box around it. So for right padding the padding is stuck at the end of that inline element only.

It has nothing to do with the current line and when the inline element spreads over 2 or more line-boxes then it takes the padding with it still attached to the end of that inline element (e.g. piece of text in your case).

If you applied left padding to an inline element (say text) and the text wraps to the next line then there wouldn't be any left padding on the new line because the left padding is only applied at the start of the element.

Applying padding to inline elements is like gluing a bit of padding on to that bit of text at the point specified.

If you want to create padding at either end of a block box then you would need to make the anchor display:block and then padding is applied to the box and not the inline text content.

Yes margins and padding on inline elements apply to those inline boxes and not the block box that surrounds it. The inline box model is a lot more complicated than the block box model and has its own set of rules to abide by

As Somme mentioned above putting padding on the list would have achieved the same result.