It's the spaces (the line breaks) between the <a>
elements in your html. This happens on all inline
or inline-block
elements.
OPTION 1:
Use margin-right:-4px;
on the <a>
tags.
OPTION 2:
Remove the spaces between the <a>
tags.
OPTION 3:
Change the <a>
tags to display:block; float:left
as described in other answers. In this case, you need to fix the height of the container element (<nav>
in your case), or use a clear:left
on the next element to prevent the floats overlapping it. Sometimes it's useful to avoid this floating approach and use one of the other options.