css - Horizontal sub menu flexible width -


i have horizontal navigation want have horizonyal sub nav come off of. issue having sub nav display inline while has absolute position. know there issues using inline display when have absolute position. works how want fixed display, not want fixed... know alternative this? can't have set width on sub nav because each of sub menu's going different width's.

<style>      ul li {         float: left;         position: relative;     }      #primary-nav ul li ul {         position: relative;         top: 42px;         display: none;         width:100%;      }     #primary-nav ul li ul li {         list-style:none outside none;         margin-left:20px;         float:left;         z-index: 1000;     }     #primary-nav ul li:hover ul {         display:inline;         position:absolute;     } </style>   <ul class="menu">     <li>menu item</li>     <li>drop down</li>         <ul class="submenu">             <li>dropdown item</li>             <li>dropdown item</li>         </ul>  </ul> 

here's tinkerbin solution -> http://tinkerbin.com/nlqcjcl7

by applying white-space: nowrap absolutely positioned .submenu, ensure it's children inline blocks don't collapse next line.


Comments

Popular posts from this blog

c# - SVN Error : "svnadmin: E205000: Too many arguments" -

c# - Copy ObservableCollection to another ObservableCollection -

All overlapping substrings matching a java regex -