# [SOLVED] Horizontal menu with full width submenu



## Natsuke (Apr 15, 2011)

Hi all. 
Im trying to create a menu from title but after several days of trying I'm not sure if it's possible so I need your help.
In attachment is example of what I'm trying to achieve.
Basically, when I hover over menu item, it slides out submenu which has width of whole menu <div> not just parent menu item, and also not full browser window width. There will be 3 or 4 menu items which will need its submenu contents. While I was trying this I got submenus to show but never on place I need it because when I set it's position all other submenus took same info and moved around.

Thanks in advance, Natsuke


----------



## brent.charlebois (May 8, 2007)

*Re: Horizontal menu with full width submenu*

Here is some code for menus...hope this helps:


```
<!DOCTYPE html>

<html>
<head>

<style>
/*---- CROSS BROWSER DROPDOWN MENU ----*/
ul#nav {margin: 0 0 0 200px;}
ul.drop a { display:block; color: #fff; font-family: Verdana; font-size: 14px; text-decoration: none;}
ul.drop, ul.drop li, ul.drop ul { list-style: none; margin: 0; padding: 0; border: 1px solid #fff; background: #555; color: #fff;}
ul.drop { position: relative; z-index: 597; float: left; }
ul.drop li { float: left; line-height: 1.3em; vertical-align: middle; zoom: 1; padding: 5px 10px; }
ul.drop li.hover, ul.drop li:hover { position: relative; z-index: 599; cursor: default; background: #1e7c9a; }
ul.drop ul { visibility: hidden; position: absolute; top: 100%; left: 0; z-index: 598; width: 195px; background: #555; border: 1px solid #fff; }
ul.drop ul li { float: none; }
ul.drop ul ul { top: -2px; left: 100%; }
ul.drop li:hover > ul { visibility: visible }
</style>

</head>

<body>

<ul id="nav" class="drop">
  <li><a href="#">Home</a></li>
  <li>About Us
    <ul>
      <li><a href="#">History</a></li>
      <li><a href="#">Clients</a></li>
      <li><a href="#">Testimonials</a></li>
      <li><a href="#">Staff</a>
        <ul>
          <li><a href="#">George Orsmond</a>
            <ul>
              <li>Web Design</li>
              <li>Graphic Design</li>
              <li>HTML</li>
              <li>CSS</li>
            </ul>
          </li>
          <li><a href="#">Dave Macleod</a></li>
        </ul>
      </li>
      <li><a href="#">FAQs</a></li>
    </ul>
  </li>
  <li>Services
    <ul>
      <li><a href="#">Web Design</a></li>
      <li><a href="#">Graphic Design</a></li>
      <li><a href="#">Logo Design</a></li>
    </ul>
  </li>
  <li>Products
    <ul>
      <li class="dir"><a href="#">Templates</a></li>
      <li class="dir"><a href="#">Stock Images</a>
        <ul>
          <li><a href="#">Category 1</a></li>
          <li><a href="#">Category 2</a></li>
          <li><a href="#">Category 3</a></li>
          <li><a href="#">Category 4</a></li>
          <li><a href="#">Category 5</a></li>
        </ul>
      </li>
      <li><a href="#">Featured</a></li>
      <li><a href="#">Top Rated</a></li>
      <li><a href="#">Resources</a></li>
    </ul>
  </li>
  <li><a href="#">Gallery</a></li>
  <li>Contact Us
    <ul>
      <li><a href="#">Contact Form</a></li>
      <li><a href="#">How to get here</a></li>
      <li><a href="#">View the map</a></li>
    </ul>
  </li>
</ul>

</body>
</html>
```


----------



## Natsuke (Apr 15, 2011)

*Re: Horizontal menu with full width submenu*

Thanks for suggestion but it's just normal drop down that starts only from it's parent <li> and doesn't stretch to whole menu. See my attachment, the submenu should go from beggining of first <li> to end of last <li> under whole menu <div>.
I'm not even sure it's possible in pure CSS, maybe JS but Im not that experienced.
I have seen it on some sites like:
Camera, HD TV, Blu-ray, MP3 player, laptop | Sony

When you hover over products, offers, shops etc you will see menu dimensions. That kind of menu is what I need.


----------



## Natsuke (Apr 15, 2011)

*Re: Horizontal menu with full width submenu*

After several days of thumping in the dark I actually figured it out and menu now works as intended - pure CSS, no JS or anything else.
Being a relative newbie such things will always give me extra work


----------

