html - Multiple lines in a horizontally-floated list item -


i'm trying create navigation menu website, links aligned horizontally near top of page, , want each link have short description underneath. when user clicks on either main link text or description underneath, should take them right page. additionally, each menu item should have triangle-shaped icon bullet. this picture of i'm trying achieve.

i can make list align horizontally when it's 1 line. breaks down when try add more.

<nav id = "header-navigation">   <ul>     <li>       <a href="/">         home         <span class = "subnavigation">foo!</span>       </a>     </li>     <li>       <a href="/contact">         contact          <span class = "subnavigation">bar</span>     </li>   </ul> </nav><!-- header-navigation --> 

and in css:

nav#header-navigation {   margin-top: 160px;   display: block; }  nav#header-navigation ul li:before {     content: url("../images/main-navigation-bullet.png");     vertical-align: top; }  nav#header-navigation ul li {     display: inline;     text-transform: uppercase;     min-height: 22px; }  nav#header-navigation ul li span.subnavigation {   display: block;   color: #999;   font-size: 90%;   margin-top: -10px;   margin-left: 15px; } 

this get.

i've tried putting float: left on nav#header-navigation ul li, causes list items float on place, top of screen, outside of containing div belong.

another problem i've found chrome doesn't display vertical-align: top; attribute correctly, subnavigation text displays in wrong place on browser.

is there way work across browsers, or still sort of thing that's best done using images?

it appears changes need are:

nav#header-navigation ul li{     display: inline-block; }  nav#header-navigation ul li a{     display: inline-block;     vertical-align: top; } 

and rid of

nav#header-navigation ul li span.subnavigation {     margin-top: -10px;     margin-left: 15px; } 

after making these changes, appears correctly in firefox , chromium on linux mint 15.


Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -