I am coding a horizontal navigation bar for my site. The html is as follows:
<nav> <ul> <li class="special_text"><a href="#">Hello1</a></li> <li><a href="#">Hello2</a></li> <li><a href="#">Hello3</a></li> </ul> </nav>
css is as follows:
* { margin: 0; padding: 0; } body { background-color: white; margin: 15px auto; border: 1px solid black; } header { } ul { list-style: none; padding: 1em 0; border-bottom: 2px solid #61f231; border-top: 2px solid #61f231; } li { display: inline; padding: 0 1.5em; border-left: 2px solid #61f231; } li.special_text { font-size: 200%; font-weight: bold; color: black; font-family: "Arial Black"; } li.special_text a { text-decoration: none; }
I would like for some <li> elements to align to the left, while others to align to the right. When I try to put the ones that I need left or right, there is a problem with vertical alignment (elements are no longer vertically aligned inside the <ul> element.
Part of the problem arises because the first <li> element uses a font of a different size.
Any suggestions?
thanks
source share