html - Why is text not positioned properly within list element? -


this problem looks like:

enter image description here

here mark up:

                    <nav class="padding_bottom">                         <ul>                             <li><a class="selected" href="#">home</a></li>                             <li><a href="#">music</a></li>                             <li><a href="#">contact</a></li>                         </ul>                     </nav> 

and styling:

nav {     height: 100%; }  nav li {     font-size: 3em;     letter-spacing: -4.5px;     text-transform: uppercase; }  nav li:nth-child(2),  nav li:nth-child(3) {     margin-left: .25em; }  nav {     color: #dddddd; }  nav a:hover, .selected {     color: black; } 

i can;t figure out why happening. i've played around wiht lot of styling elements see if changed, problem persisted.

@michaelpitluk:

it's caused -ve letter-spacing, if remove background color extends expected. may need add padding or margin, whichever works best situation, <a> elements.

example fiddle


Comments

Popular posts from this blog

html5 - What is breaking my page when printing? -

html - Unable to style the color of bullets in a list -

c# - must be a non-abstract type with a public parameterless constructor in redis -