title: Dynamic Drop Down with UL and DIVs
body: <p>Here's my situation:</p>
  
  <p>I want to make a CSS dropdown. Normally I can do this no problem with embedded <code>UL</code>s. However, I want to make a multi-column dropdown. I need the dropdowns to be of dynamic width though.</p>
  
  <p>I have accomplished this with tables, but Id like to see if I could do it with <code>DIV</code>s.</p>
  
  <p>My CSS for the drop down <code>UL</code>/<code>LI</code> is:</p>
  
  <pre><code>#nav ul {
  margin: 0;
  padding: 0;
  list-style: none;
  }
  
  #nav ul li {
  position: relative;
  float:left;
  margin-left:16px;
  }
  
  #nav li ul {
  position: absolute;
  display: none;
  z-index:10;
  }
  
  #nav li:hover ul { 
  display:block;
  }
  
  #nav ul li a.main {
  display: block;
  height:47px;
  text-decoration: none;
  color: #fff;
  padding: 0 16px 0 16px;
  line-height: 48px;
  border-top: 1px solid transparent;
  border-right: 1px solid transparent;
  border-left: 1px solid transparent;
  font-weight:bold;
  }
  
  #nav ul li a.main:hover {
  background:#FFF;
  color:#222222;
  border-top: 1px solid #000;
  border-right: 1px solid #000;
  border-left: 1px solid #000;
  }
  </code></pre>
  
  <p>That creates the horizontal navigation with drop downs with this HTML:</p>
  
  <pre><code>&lt;ul&gt;
   &lt;li&gt;&lt;a class="main"&gt;HO Scale&lt;/a&gt;
     &lt;ul&gt;
  
     &lt;/ul&gt;
   &lt;/li&gt;
  &lt;/ul&gt;
  </code></pre>
  
  <p>Using a table, I can put it inside the inner <code>UL</code> and use this CSS</p>
  
  <pre><code>.inner{
      float:left;
      background:#FFF;
      border:1px solid #000;
      border-top:0;
      padding:12px 0 12px 12px;
  }
  </code></pre>
  
  <p>By putting a <code>Table</code> with class of inner in those inner <code>UL</code>s it will work perfectly, space them out, 3 columns, all dynamic width.</p>
  
  <p>I'd like to accomplish that with <code>DIV</code>s, but the problem is when I float (or don't float) the "inner" <code>DIV</code> it puts all of the links on the inside one to a line, I can't seem to make them go side by side. If I put the <code>DIV</code> OUTSIDE thee dropdown, it works just fine.</p>
  
  <p>Any suggestions?</p>
  
  <p>EDIT:</p>
  
  <p>This is how it should look (and does with tables):</p>
  
  <p><img src="https://i.stack.imgur.com/myoo9.png" alt="enter image description here"></p>
  
  <p>This is how it looks with <code>DIV</code>s (wrong)</p>
  
  <p><img src="https://i.stack.imgur.com/IIxCZ.png" alt="enter image description here"></p>