For some reason the z-index is not working properly in ie7 only. If I remove position:fixed from #header it works fine, however, as this menu is to be fixed at the top of the page this is needed. The drop down shows, but only over the bottom border and nothing below that. Can't figure this one out.
fiddle
<!-- start fixed header container -->
<div id="header_container">
<!-- start header -->
<div id="header">
<!-- start container -->
<nav>
<div class="container">
<div id="logo">logo here</div>
<div id="top_menu">
<ul>
<li>Features
<div class="drop">
<div>
<ul>
<li class="title">heading with link</li>
<li>testing 1</li>
<li>testing 2</li>
<li>testing 3</li>
</ul>
<ul>
<li class="title">and another heading</li>
<li>testing 1</li>
<li>testing 2</li>
<li>testing 3</li>
</ul>
</div>
<div class="extra">
<ul>
<li class="title">heading with NO link</li>
<li>testing 4</li>
<li>testing 5</li>
<li>testing 6</li>
</ul>
<ul>
<li class="title">plain info description goes as far as I want <br />with no link blah blah blah blah blah</li>
</ul>
</div>
</div>
</li>
<li>Download</li>
<li>Purchase</li>
<li>Support
<div class="drop">
<div>
<ul>
<li class="title">How can we help you?</li>
<li>FAQs</li>
<li>How To Guides</li>
<li>Online Documentation</li>
<li>Contact Us</li>
</ul>
</div>
</div>
</li>
<li>Account Login</li>
</ul>
</div>
</div>
</nav>
<!-- end container -->
<div class="header_shadow"></div>
</div>
<!-- end header -->
</div>
<!-- end header container -->
#header_container{
width:100%;
height:52px;
}
#header{
width:100%;
height:50px;
position:fixed;
border-bottom:2px #3c9ac4 solid;
background: #00457b;
background-image: -webkit-gradient(linear, left top, left bottom, from(#1e70b2), to(#00457b));
background-image: -webkit-linear-gradient(top, #1e70b2, #00457b);
background-image: -moz-linear-gradient(top, #1e70b2, #00457b);
background-image: -ms-linear-gradient(top, #1e70b2, #00457b);
background-image: -o-linear-gradient(top, #1e70b2, #00457b);
background-image: linear-gradient(top, #1e70b2, #00457b);
}
.ie8 #header, .ie9 #header{
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#1e70b2', endColorstr='#00457b',GradientType=0 ) ;
}
.header_shadow{
width:100%;
height:10px;
position:absolute;
z-index:900;
display:none;
left:0;
top:52px;
background:url(/images/header_shadow.png) repeat-x;
}
/* Top Menu
================================================== */
#logo{
width:200px;
float:left;
}
/*menu container centered*/
#top_menu{
width:760px;
float:left;
}
/*entire menu ul*/
#top_menu ul{
position:relative;
z-index:1000;
margin:0;
float:right;
height:50px;
line-height:50px;
}
/*top link container*/
#top_menu ul li{
display:block;
float:left;
}
/*top link*/
#top_menu ul li a{
display:block;
color:#f1f1f1;
text-decoration:none;
padding:0 20px;
font-size:14px;
}
/*top link hover*/
#top_menu ul li:hover > a{
color: #f1f1f1;
background:#555555;
}
/*show dropdown and position under tab*/
#top_menu ul li:hover > .drop{
display:block;
top:auto;
}
/*drop down container*/
#top_menu ul li .drop{
position:absolute;
z-index:1000;
display:none;
padding:15px 0 0 0;
-moz-border-radius:0 0 8px 8px;
-webkit-border-radius:0 0 8px 8px;
border-radius:0 0 8px 8px;
background:#555555;
background-image: -webkit-gradient(linear, left top, left bottom, from(#555555), to(#202020));
background-image: -webkit-linear-gradient(top, #555555, #202020);
background-image: -moz-linear-gradient(top, #555555, #202020);
background-image: -ms-linear-gradient(top, #555555, #202020);
background-image: -o-linear-gradient(top, #555555, #202020);
background-image: linear-gradient(top, #555555, #202020);
font-size:13px;
}
.ie8 #top_menu ul li .drop{
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#555555', endColorstr='#202020',GradientType=0 ) ;
}
.ie9 #top_menu ul li .drop{
background-image:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIHZpZXdCb3g9IjAgMCAxIDEiIHByZXNlcnZlQXNwZWN0UmF0aW89Im5vbmUiPgo8bGluZWFyR3JhZGllbnQgaWQ9Imc1ODIiIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIiB4MT0iMCUiIHkxPSIwJSIgeDI9IjAlIiB5Mj0iMTAwJSI+CjxzdG9wIHN0b3AtY29sb3I9IiM1NTU1NTUiIG9mZnNldD0iMCIvPjxzdG9wIHN0b3AtY29sb3I9IiMyMDIwMjAiIG9mZnNldD0iMSIvPgo8L2xpbmVhckdyYWRpZW50Pgo8cmVjdCB4PSIwIiB5PSIwIiB3aWR0aD0iMSIgaGVpZ2h0PSIxIiBmaWxsPSJ1cmwoI2c1ODIpIiAvPgo8L3N2Zz4=);
}
/*drop down div*/
#top_menu ul li .drop div{
float:left;
padding:0 30px 0 10px;
line-height:normal;
}
/*drop down div floated left*/
#top_menu ul li .drop div.extra{
/*border-left:1px #eeeeee solid;*/
}
#top_menu ul li .drop div .title, #top_menu ul li .drop div .title a{
padding:0 0 4px 0;
border:none;
color:#f1f1f1;
font-size:13px;
}
#top_menu ul li .drop div .title a:hover{
text-decoration:underline;
}
#top_menu ul li .drop div ul{
width:auto;
height:auto;
float:none;
background:none;
border:none;
margin:0 0 15px 0;
}
#top_menu ul li .drop div ul li{
float:none;
padding:1px 0 1px 0;
line-height:normal;
}
#top_menu ul li .drop div ul li:hover a{
background:none;
}
#top_menu ul li .drop div ul li a{
display:inline;
padding:0;
border:none;
color:#6cc5d8;
font-size:13px;
}
#top_menu ul li .drop div ul li a:hover{
text-decoration:underline;
}
I was able to solve the issue by adding yet another wrapper wound the header and making it position fixed. So it goes as container the width/height (to keep spacing of the rest of the page correct), container width/height fixed, then header container with logo/drop-down within that. Solves the problem in ie7 and every other browser worked fine before.
Related
I want to make my menu's center on the navbar using materializecss
My HTML code:
<div class="navbar-utility theme">
<ul class="right">
<li>
<a href="#" id="navbar-search-trigger">
<i class="material-icons">search</i>
</a>
</li>
<li>
<a href="#" id="navbar-full-screen">
<i class="fa fa-arrows-alt tiny"></i>
</a>
</li>
<li>
<a class="dropdown-button" href="#!" data-activates="dropdown1">
Dropdown
<i class="material-icons right">arrow_drop_down</i>
</a>
</li>
</ul>
</div>
My CSS code is below:
.navbar-utility{
-webkit-box-shadow: inset 0 20px 20px -20px rgba(0,0,0,0.8);
-moz-box-shadow: inset 0 20px 20px -20px rgba(0,0,0,0.8);
box-shadow: inset 0 20px 20px -20px rgba(0,0,0,0.8);
width: 100%;
position: fixed;
top: 64px;
text-align: center;
}
.navbar-utility ul.right{
float: left;
clear: both;
margin:0px auto;
text-align:center;
}
but this doesn't seem to work. Any help would be appreciated.
You just try this code..
<div id="menu">
<ul>
<li>Tab one</li>
<li>Tab two</li>
<li>Tab three</li>
<li>Tab four</li>
</ul>
</div>
#menu {
float:left;
width:100%;
background:#fff;
border-bottom:4px solid #000;
overflow:hidden;
position:relative;
}
#menu ul {
clear:left;
float:left;
list-style:none;
margin:0;
padding:0;
position:relative;
left:50%;
text-align:center;
}
#menu ul li {
display:block;
float:left;
list-style:none;
margin:0;
padding:0;
position:relative;
right:50%;
}
#menu ul li a {
display:block;
margin:0 0 0 1px;
padding:3px 10px;
background:#ddd;
color:#000;
text-decoration:none;
line-height:1.3em;
}
#menu ul li a:hover {
background:#369;
color:#fff;
}
#menu ul li a.active,
#menu ul li a.active:hover {
color:#fff;
background:#000;
font-weight:bold;
}
Made this menu this afternoon. Tab number 1 has a drop down that consists of two divs that should each be floated left so there are two divs next to each other, however, it does not work and the second lines up underneath the first.
This is the line which I thought would do the floating :
/*sub container div*/
.container ul li .drop div{
float:left;
}
Fiddle
HTML
<!-- start menu -->
<div id="top_menu">
<nav>
<div class="container">
<ul>
<li><img class="home" alt="" height="20" src="/images/trans.gif" width="20"> </li>
<li>number 1
<div class="drop">
<div>
category 1
<ul>
<li>test1</li>
<li>test2</li>
<li>test3</li>
<li>test4</li>
</ul>
category 2
<ul>
<li>test1</li>
</ul>
</div>
<div>
category 3
<ul>
<li>test1</li>
<li>test2</li>
<li>test3</li>
<li>test4</li>
</ul>
category 4
<ul>
<li>test1</li>
</ul>
category 5
<ul>
<li>test1</li>
</ul>
</div>
<div>
</div>
</li>
<li>number 2</li>
<li>number 3</li>
<li>number 4</li>
<li>number 5</li>
</ul>
</div>
</nav>
</div>
<!-- end menu -->
CSS
#top_menu{
background:#cccccc url('/images/top_menu_bg.png') repeat;
}
.container{
position:relative;
z-index:1000;
border-left:1px #b2b2b2 solid;
border-right:1px #b2b2b2 solid;
}
.container ul{
white-space:nowrap;
/*display:table;*/
}
.container ul, .container li{
padding:0;
margin:0;
list-style:none;
}
/*top level link*/
.container ul a{
display:block;
color:#666666;
text-decoration:none;
padding:0 25px;
line-height:40px;
border-right:1px #b2b2b2 solid;
}
/*sub container*/
.container ul li .drop{
position:absolute;
background:#fdfdfd;
-moz-border-radius:0 0 8px 8px;
-webkit-border-radius:0 0 8px 8px;
border-radius:0 0 8px 8px;
display:none;
border-left:1px #b2b2b2 solid;
border-right:1px #b2b2b2 solid;
border-bottom:1px #b2b2b2 solid;
}
/*sub container div*/
.container ul li .drop div{
float:left;
}
.container ul li .drop li{
display:block;
border:0;
}
.container > ul > li{
float:left;
display:block;
position:relative;
}
.container ul li:hover > .drop{
top:auto;
display:block;
}
/*sub level top link*/
.container ul li .drop a{
line-height:25px;
border:0;
padding:0 30px 0 10px;
color:#000000;
}
/*sub level top link hover*/
.container ul li .drop a:hover{
color:#00396d;
background:#c4dcec;
}
/*sub level link normal*/
.container ul li .drop li > a{
color:#666666;
}
/*sub level link hover*/
.container ul li .drop li:hover > a{
background:#c4dcec;
color:#00396d;
}
/*top level link hover*/
.container li:hover > a{
color: #000000;
}
/*home button*/
.container ul li img.home{
background:url('/images/top_menu_home.png') 0 0;
width:20px;
height:20px;
}
/*home button hover*/
.container ul li:hover > a img.home{
background:url('/images/top_menu_home.png') -20px 0;
}
Sorry for the late reply =) Still, if you want to stack several elements of variable width horizontally, I'd suggest using display:inline-block.
/*sub container div*/
.container ul li .drop div{
display:inline-block;
vertical-align:top;
}
The fiddle (works in fFF 8, Chrome 12, IE 9).
The drawback is spaces between elements, which can be successfully eliminated
.container ul li .drop{
position:absolute;
background:#fdfdfd;
-moz-border-radius:0 0 8px 8px;
-webkit-border-radius:0 0 8px 8px;
border-radius:0 0 8px 8px;
display:none;
border-left:1px #b2b2b2 solid;
border-right:1px #b2b2b2 solid;
border-bottom:1px #b2b2b2 solid;
width: 300px; //set width
}
/*sub container div*/
.container ul li .drop div{
float:left;
width:50%; //optional
}
I have a horizontal menu based on this that is pure CSS and HTML and am trying to center align the dropdown divs under each top level menu item but am having some difficulty getting it to work. It currently aligns to the right, and any changes I make when changing to "relative" positioning of the child elements correct alignment of the parent/child but then throw off the top level items because the children take up the space between items.
Below is the code for an item, followed by the associated CSS.
Html:
<ul id="menu">
<li>Home
<div class="dropdown_2columns">
<div class="col_1">
<p class="black_box">Download stuff here<br><img src="img/menu-button.png"></a></p>
</div>
<div class="col_1">
<ul>
<li><a href="#">Item 1</li>
<li><a href="#">Item 2</li>
<li><a href="#">Item 3</li>
</ul>
</div>
</div>
</li>
CSS
#menu {
text-align:center;
color: #2262a0;
list-style:none;
width:690px;
margin:30px auto 0px auto;
height:28px;
padding:0px 20px 10px 20px;
background: #fff;
}
#menu li {
float:left;
display:block;
text-align:center;
position:relative;
padding: 4px 10px 4px 10px;
margin-right:0px;
margin-top:7px;
border:none;
}
#menu li:hover {
padding: 4px 9px 4px 9px;*/
}
.dropdown_1column,
.dropdown_2columns,
.dropdown_3columns,
{
background:url("img/blue-arrow.png") no-repeat center 0px z-index;
margin:10px auto;
float:left;
display: inline-block;
position:absolute;
left:-999em; /* Hides the drop down */
text-align:center;
padding:10px 5px 10px 5px;
border-left:1px solid #e5edf4;
border-right:1px solid #e5edf4;
border-top:3px solid #004b91;
border-bottom:3px solid #e5edf4;
}
.dropdown_1column {width: 260px;}
.dropdown_2columns {width: 520px;}
.dropdown_3columns {width: 780px;}
#menu li:hover .dropdown_1column,
#menu li:hover .dropdown_2columns,
#menu li:hover .dropdown_3columns,
{
left:-1px;
top:auto;
}
.col_1,
.col_2,
.col_3,
{
display:inline;
float: left;
position: relative;
margin-left: 5px;
margin-right: 5px;
}
.col_1 {width:250px;}
.col_2 {width:500px;}
.col_3 {width:750px;}
Any CSS guru's out there care to send some advise?
In the example posted you can move the boxes by changing
#menu li:hover .dropdown_1column, #menu li:hover .dropdown_2columns, #menu li:hover .dropdown_3columns, #menu li:hover .dropdown_4columns, #menu li:hover .dropdown_5columns
{
left: -212px; /*for column 4*/
}
Of course you would have to have a static width for each box and style them accordingly.
New to CSS. I've got a Horizontal menu that I want to convert to a drop down menu.
Here's the CSS:
.menu_container {
position:relative;
}
ul.semiopaquemenu{ /* main menu UL */
font-family: 'Metrophobic', Arial, serif; font-weight: 800;
font-size:18px;
width: 100%;
background: #ccc;
padding: 11px 0 8px 0; /* padding of the 4 sides of the menu */
margin: 0;
text-align: left; /* set value to "left", "center", or "right" to align menu accordingly */
}
ul.semiopaquemenu li{
display: inline;
}
ul.semiopaquemenu li a{
color:white;
padding: 6px 8px 6px 8px; /* padding of the 4 sides of each menu link */
margin-right: 15px; /* spacing between each menu link */
text-decoration: none;
}
ul.semiopaquemenu li a:hover, ul.semiopaquemenu li a.selected{
color: #0080FF;
background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPGxpbmVhckdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iMCUiIHgyPSIwJSIgeTI9IjEwMCUiPgogICAgPHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2ZmZmZmZiIgc3RvcC1vcGFjaXR5PSIwLjgyIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiNmZmZmZmYiIHN0b3Atb3BhY2l0eT0iMC4xNiIvPgogIDwvbGluZWFyR3JhZGllbnQ+CiAgPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEiIGhlaWdodD0iMSIgZmlsbD0idXJsKCNncmFkLXVjZ2ctZ2VuZXJhdGVkKSIgLz4KPC9zdmc+); /* IE9+ SVG equivalent of linear gradients */
background: -moz-linear-gradient(top, rgba(255,255,255,0.82) 0%, rgba(255,255,255,0.16) 100%); /* fade from white (0.82 opacty) to 0.16 opacity */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(255,255,255,0.82)), color-stop(100%,rgba(255,255,255,0.16)));
background: -webkit-linear-gradient(top, rgba(255,255,255,0.82) 0%,rgba(255,255,255,0.16) 100%);
background: -o-linear-gradient(top, rgba(255,255,255,0.82) 0%,rgba(255,255,255,0.16) 100%);
background: -ms-linear-gradient(top, rgba(255,255,255,0.82) 0%,rgba(255,255,255,0.16) 100%);
background: linear-gradient(top, rgba(255,255,255,0.82) 0%,rgba(255,255,255,0.16) 100%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#d1ffffff', endColorstr='#29ffffff',GradientType=0 );
-moz-box-shadow: 0 0 10px #595959; /* CSS3 box shadows */
-webkit-box-shadow: 0 0 10px #595959;
box-shadow: 0 0 10px #595959;
padding-top: 12px; /* large padding to get menu item to protrude upwards */
padding-bottom: 9px; /* large padding to get menu item to protrude downwards */
}
.semiopaquemenu ul {
position:absolute;
left:-9999px;
top:-9999px;
list-style-type:none;
}
.semiopaquemenu li:hover {
position:relative;
}
.semiopaquemenu li:hover ul {
left:0px;
top:30px;
padding:3px;
width:160px;
}
.semiopaquemenu li:hover ul li {
height:18px;
border:none;
}
.semiopaquemenu li:hover ul li a {
height:18px;
padding:0px;
display:block;
width:158px;
line-height:18px;
text-indent:5px;
}
.semiopaquemenu li:hover ul li a:hover {
height:18px;
}
Here's my HTML:
<ul class="semiopaquemenu">
<li>Home</li>
<li>Messaging</li>
<li>Directory</li>
<li>Options</li>
</ul>
How can I convert menu item "Options" to a drop down???
Thanks!
demo jsBin
Add this lines and play around:
CSS:
ul.semiopaquemenu > li > ul{
background:#ccc;
padding:15px 20px;
}
ul.semiopaquemenu > li > ul li {
color:white;
cursor:pointer;
display:block;
padding:4px 10px;
}
HTML:
<ul class="semiopaquemenu">
<li>Home</li>
<li>Messaging</li>
<li>Directory</li>
<li>
Options
<ul>
<li>Option 1</li>
<li>Option 2</li>
<li>Option 3</li>
<li>Option 4</li>
</ul>
</li>
</ul>
Well, for starters you'll need some extra list items to actually have something to "drop down", so another <ul>. The place to put it is <li>Options RIGHT HERE </li>. To get something going, just copy/paste the HTML you already have into itself at that point:
<ul class="semiopaquemenu">
<li>Home</li>
<li>Messaging</li>
<li>Directory</li>
<li>Options
<ul class="semiopaquemenu">
<li>Home</li>
<li>Messaging</li>
<li>Directory</li>
<li>Options</li>
</ul>
</li>
</ul>
Which with your current CSS produces this, a working drop down menu: http://jsfiddle.net/yAmWb/
I am trying to create a css horizontal drop down menu that will show the children in a horizontal subnav. What I have so far is: (this is incomplete but I am stuck)
<ul class="menu">
<li class="top">Home</li>
<li class="top">
About
<ul class="sub">
<?php wp_list_pages('title_li=&child_of=2') ?>
</ul>
</li>
<li class="top">
Services
<ul class="sub">
<?php wp_list_pages('title_li=&child_of=5') ?>
</ul>
</li>
<li class="top">
Projects
<ul class="sub">
<?php wp_list_pages('title_li=&child_of=7') ?>
</ul>
</li>
<li class="top">
Team
<ul class="sub">
<?php wp_list_pages('title_li=&child_of=10') ?>
</ul>
</li>
</ul>
and the css:
.menu {padding:50px 0 0; list-style:none; line-height:1; width:400px;}
.menu li.top {display:block; float:left; position:relative; padding:0 17px 0 0;}
.menu li a.top_link {display:block; float:left; height:40px; line-height:33px; color:#bbb;
text-decoration:none; font-size:11px; font-weight:bold; padding:0 0 0 12px;
cursor:pointer;}
.menu li a.top_link span {float:left; font-weight:bold; display:block; padding:0 24px 0
12px; height:40px;}
.menu li a.top_link span.down {float:left; display:block; padding:0 24px 0 12px;
height:40px; background:url(images/down.gif) no-repeat right top;}
.menu li a.top_link:hover {color:#000; background: url(images/button4.gif) no-repeat;}
.menu li a.top_link:hover span {background:url(images/button4.gif) no-repeat right top;}
.menu li a.top_link:hover span.down {background:url(images/button4a.gif) no-repeat right
top;}
.menu li:hover > a.top_link {color:#000; background: url(images/button4.gif) no-repeat;}
.menu li:hover > a.top_link span {background:url(images/button4.gif) no-repeat right top;}
.menu li:hover > a.top_link span.down {background:url(images/button4a.gif) no-repeat right
top;}
.menu table {border-collapse:collapse; width:0; height:0; position:absolute; top:0;
left:0;}
.menu a:hover {visibility:visible;}
.menu li:hover {position:relative; z-index:200;}
.menu ul,
.menu :hover ul ul,
.menu :hover ul :hover ul ul,
.menu :hover ul :hover ul :hover ul ul,
.menu :hover ul :hover ul :hover ul :hover ul ul {position:absolute; left:-9999px; top:-
9999px; width:0; height:0; margin:0; padding:0; list-style:none;}
.menu :hover ul.sub {left:2px; top:20px; right:2px; background: #fff; padding:3px 0;
white-space:nowrap; width:200px; height:auto;}
.menu :hover ul.sub li {display:block; height:20px; position:relative; float:left;
width:250px;}
.menu :hover ul.sub li a {float:right;font-weight:normal;display:block; font-size:11px;
color:#000; text-decoration:none;}
.menu :hover ul :hover ul,
.menu :hover ul :hover ul :hover ul,
.menu :hover ul :hover ul :hover ul :hover ul,
.menu :hover ul :hover ul :hover ul :hover ul :hover ul
{left:90px; top:-4px; background: #fff; padding:3px 0; border:1px solid 999999; white-
space:nowrap; width:93px; z-index:200; height:auto;}
I really need some help I can not get this to work at all and need to running ASAP!
Rendered HTML:
<ul class="menu">
<li class="top">Home</li>
<li class="top">
About
<ul class="sub">
<li class="page_item page-item-33">Why CVA?</li>
</ul>
</li>
<li class="top">
Services
<ul class="sub">
</ul>
</li>
<li class="top">
Projects
<ul class="sub">
</ul>
</li>
<li class="top">
Team
<ul class="sub">
<li class="page_item page-item-19">Contact Us</li>
</ul>
</li>
</ul>
Instead of fixing this mess, here's a simple example you can use and apply:
HTML
<div class='menu'>
<a href=''>One</a><a href=''>Two</a><a href=''>Three</a>
</div>
<div class='menu'>
<a href=''>One</a><a href=''>Two</a>
</div>
<div class='menu'>
<a href=''>One</a><a href=''>Two</a><a href=''>Three</a><a href=''>Four</a>
</div>
CSS
.menu { float:left; line-height:20px; border:1px solid black; height:20px;
overflow:hidden; margin-right:10px; }
.menu a { display:block }
.menu:hover { height:auto; }
Doesn't look good, but it works. You can style it to look beautiful later. (Don't forget the doctype to enable :hover.)
// Edit
Sorry just noticed the 'horizontal' part. This is a vertical dropper. Will leave it up though just in case it helps you.