In order to fix the issue, try changing the inline
display of the <li>
to float:left
.
Give it a shot: http://jsfiddle.net/RGvjj/1/
#navigation li {
font-size: 20px;
margin-left: 10px;
padding-left: 10px;
border-left: 3px solid #1161A5;
color: #ffffdd;
text-decoration: none;
float:left;
}
UPDATE: To clarify, this issue likely occurs because jQuery changes the display
property to block
when animating an element. This results in a block
element (the <a>
) inside an inline
element (the <li>
), which is not compatible.
Using float:left
ensures that the <li>
maintains its block
display, allowing the <a>
to also be a block
element.