Arrow under navigation - html

Hi I've looked up ways to place an arrow under my navigation but I can't get to work on my navigation bar. Any help would be much appreciated.
<nav>
<div class="hello"></div>
<ul>
<li class="icon-home"><span>Home</span></li>
<li class="arrow"> <a class="star" href="#">England</a>
<ul>
<li>Premiership
</li>
<li>Championship
</li>
<li>League 1
</li>
<li>League 2
</li>
</ul>
</li>
<li class="arrow"> France
<ul >
<li id="r">Ligue 1
</li>
</ul>
</li>
<li class="arrow"> Germany
<ul>
<li>Bundesliga
</li>
</ul>
</li>
<li class="arrow"> Italy
<ul>
<li>Serie A
</li>
</ul>
</li>
<li class="arrow"> Spain
<ul>
<li>La Liga
</li>
</ul>
</li>
</ul>
<div class="handle"> Menu </div>
</nav>
I thought that is css would work but it hasn't
li a:after {
content: '';
display: none;
width: 0;
height: 0;
border-top: 6px solid #333;
border-right: 6px solid transparent;
border-left: 6px solid transparent;
position: absolute;
z-index: 1;
top: 100%;
left: 50%;
margin-left: -6px
}
my code https://jsfiddle.net/jzqv6kr0/

In your case, the arrow is there it's just that the overflow:hidden on the ul means you can't see it.
I've adapted your code a little (see the snippet below) but it requires some tweaks to get it exactly as you might like. I've colored the arrow red for simplicity.
nav ul {
/* overflow:hidden; REMOVE */
}
nav ul li.arrow:after {
content: '';
width: 0;
height: 0;
border-top: 6px solid red;
border-right: 6px solid transparent;
border-left: 6px solid transparent;
position: absolute;
z-index: 1;
top: 100%;
left: 50%;
margin-left: -6px
}
nav ul {
background-color: #43a286;
color: white;
padding: 0;
text-align: center;
margin: 0;
-webkit-transition: max-height 0.4s;
-ms-transition: max-height 0.4s;
-moz-transition: max-height 0.4s;
-o-transition: max-height 0.4s;
transition: max-height 0.4s;
}
nav ul li {
display: inline-block;
padding: 20px;
width: 12.3%;
text-align: center;
position: relative;
}
nav ul li:hover {
background-color: #399077;
}
nav ul li.arrow:after {
content: '';
width: 0;
height: 0;
border-top: 6px solid red;
border-right: 6px solid transparent;
border-left: 6px solid transparent;
position: absolute;
z-index: 1;
top: 100%;
left: 50%;
margin-left: -6px
}
nav ul ul {
display: none;
position: absolute;
background-color: #399077;
margin-left: -3%;
z-index: 150;
}
nav ul ul li {
display: block;
width: 75%;
text-align: center;
}
nav ul li:hover ul {
margin-top: 2%;
display: block;
border-bottom-left-radius: 5%;
border-bottom-right-radius: 5%;
width: 165px;
}
nav ul li a,
visited {
color: white;
font-family: 'CFJackStory-Regular', Helvetica, Arial, sans-serif;
display: block;
text-decoration: none;
}
nav ul ul li a:hover {
color: white;
font-size: 20px;
}
<nav>
<div class="hello"></div>
<ul>
<li class="icon-home"><span>Home</span>
</li>
<li class="arrow"> <a class="star" href="#">England</a>
<ul>
<li>Premiership
</li>
<li>Championship
</li>
<li>League 1
</li>
<li>League 2
</li>
</ul>
</li>
<li class="arrow"> France
<ul>
<li id="r">Ligue 1
</li>
</ul>
</li>
<li class="arrow"> Germany
<ul>
<li>Bundesliga
</li>
</ul>
</li>
<li class="arrow"> Italy
<ul>
<li>Serie A
</li>
</ul>
</li>
</ul>
</nav>

Related

Dropdown menu only shows 2 lines instead of 3

My navbar shows only 2 of the submenu titles. Why is that?
body {
margin: 0;
padding: 0;
}
.nav ul {
list-style: none;
background-color: #36527c;
text-align: center;
padding: 0;
margin: 0;
height: 121px;
position: relative;
z-index: 99999;
}
.nav li {
font-family: Open sans hebrew;
font-size: 1.2em;
line-height: 40px;
margin-top: 35px;
position: relative;
z-index: 99999;
display: none;
}
.nav a {
text-decoration: none;
color: #fff;
display: block;
padding-left: 15px;
border-bottom: 1px solid #888;
transition: .3s background-color;
position: relative;
z-index: 99999;
}
.nav a:hover {
background-color: #aaa;
color: #444;
cursor: default;
position: relative;
z-index: 99999;
}
.nav a.active {
position: relative;
z-index: 99999;
}
/* Sub Menus */
.nav li li {
position: absolute;
z-index: 999;
font-size: .8em;
}
<div class="nav">
<ul>
<li class="home">Home</li>
<li class="tutorials">Tutorials
<ul>
<li>Tutorial #1##</li>
<li>Tutorial #2</li>
<li>Tutorial #3</li>
</ul>
</li>
<li class="about"><a class="active" href="#">About</a></li>
<li class="news">Newsletter
<ul>
<li>News #1</li>
<li>News #2###</li>
<li>News #3</li>
</ul>
</li>
<li class="contact">Contact</li>
</ul>
</div>
Your .nav UL CSS has a height set to 121px and unfortunately that doesn't just affect the first UL, it affects them all. Giving it a class or id you can bind to your height fixes that problem.
body {
margin: 0;
padding: 0;
}
.nav ul {
list-style: none;
background-color: #36527c;
text-align: center;
padding: 0;
margin: 0;
position: relative;
z-index: 99999;
}
.mainul {
height: 121px;
}
.nav li {
font-family: Open sans hebrew;
font-size: 1.2em;
line-height: 40px;
margin-top: 35px;
position: relative;
z-index: 99999;
display: none;
}
.nav a {
text-decoration: none;
color: #fff;
display: block;
padding-left: 15px;
border-bottom: 1px solid #888;
transition: .3s background-color;
position: relative;
z-index: 99999;
}
.nav a:hover {
background-color: #aaa;
color: #444;
cursor: default;
position: relative;
z-index: 99999;
}
.nav a.active {
position: relative;
z-index: 99999;
}
/* Sub Menus */
.nav li li {
position: absolute;
z-index: 999;
font-size: .8em;
}
<div class="nav">
<ul class="mainul">
<li class="home">Home</li>
<li class="tutorials">Tutorials
<ul>
<li>Tutorial #1##</li>
<li>Tutorial #2</li>
<li>Tutorial #3</li>
</ul>
</li>
<li class="about"><a class="active" href="#">About</a></li>
<li class="news">Newsletter
<ul>
<li>News #1</li>
<li>News #2###</li>
<li>News #3</li>
</ul>
</li>
<li class="contact">Contact</li>
</ul>
</div>

Text next to the menu moving the menu when more text is added

i want to make my text on the left side of the menu not interact with my menu. Every time I add text to it, it moves my menu bars to the side. Any idea how to fix it? I tried fixed position for the text but its buggy and doesn't work in Mozilla Firefox.
JsFiddle: https://jsfiddle.net/3vetp3y3/
HTML:
<nav>
<span class="nadpis"> BUR </span>
<ul class="nav">
<li class="prve">PSI
<ul>
<li>Simoncik</li>
<li>Kodrla</li>
<li>Vajs</li>
<li>Hrebicek</li>
</ul>
</li>
<li class="druhe">&#9776
<ul>
<li> RPO </li>
<li> FLV
<ul>
<li>Simoncik</li>
<li>Kodrla</li>
<li>Vajs</li>
<li>Hrebicek</li>
</ul>
</li>
<li> FLC
<ul>
<li>Bednarikova</li>
<li>Dobrikova</li>
<li>Duracka</li>
</ul>
</li>
<li> QUA
<ul>
<li>Klco</li>
<li>Cisar</li>
</ul>
</li>
<li> HFX
</li>
<li> PDT
</li>
<li> RSH
</li>
<li> BUR
</li>
<li> SUHRN </li>
<li> INCI </li>
<li> JIRA </li>
<li> CHGT </li>
<li> TASK </li>
<li> VRS </li>
</div>
</ul>
</li>
</ul>
</nav>
CSS:
body,
nav ul {
margin: 0;
padding: 0;
list-style: none;
}
nav {
display: inline-block;
position: fixed;
width: 100%;
text-align: center;
background-color: #111;
vertical-align: top;
top: -1px;
opacity: 1;
transition: 0.3s;
}
nav:hover {
opacity: 1!important;
background-color: #111;
transition: 0.3s;
}
span {
float: left;
margin-left: 3px;
}
span a {
text-decoration: none;
color: #2670CF;
background-color: #111;
font-family: 'Helvetica Neue', sans-serif;
font-size: 30px;
font-weight: bold;
}
.nav a {
display: block;
background: #111;
color: #fff;
text-decoration: none;
padding: 0.7em 1.7em;
text-transform: uppercase;
font-size: 85%;
letter-spacing: 3px;
position: relative;
}
.nav {
vertical-align: top;
display: inline-block;
width: 250px;
}
.nav li {
position: relative;
}
.nav > li {
display: inline-block;
}
.nav li:hover > a {
transition: 0.3s;
background-color: #3a3939;
color: #40d23b;
}
.nav ul {
position: absolute;
white-space: nowrap;
z-index: 1;
left: -99999em;
background-color: #000;
border: 2px solid #81D4FA;
border-top: none;
}
.nav > li:hover > ul {
left: auto;
min-width: 100%;
}
.nav > li li:hover > ul {
left: 100%;
top: -1px;
}
.nav > li:hover > a:first-child:nth-last-child(2):before {
border: 5px solid transparent;
}
.nav li li:hover > a:first-child:nth-last-child(2):before {
border: 5px solid transparent;
right: 10px;
}
.prve {
max-width: 125px;
min-width: 90px;
border: 2px solid #81D4FA;
border-bottom: none;
border-top: none;
}
.druhe {
max-width: 14px;
min-width: 110px;
border-right: 2px solid #81D4FA;
}
use position: absolute instead of float
span.nadpis {
position: absolute;
left: 0;
}
with float, the element will still own an amount of space which will affect its sibling elements
with position: absolute, the element would position itself separately from its sibling elements

navigation bar arrow not showing under each tab CSS

I want to use css to get an arrow that points down from each tab of the navigation bar. This is what I have so far.
ul {
background: rgba(0,0,0,0.3);
list-style-type: none;
padding: 0;
overflow: hidden;
margin: 0;
}
li {
float: left;
}
li a {
display: block;
color: white;
text-align: center;
padding: 16px 16px;
text-decoration: none;
-webkit-transition:color 0.5s ease-in;
}
li a:visited {
color: white;
}
li a:hover {
color: #df9fa2;
}
#menu a:hover:after {
content: "";
position: absolute;
top: 52px;
width: 0px;
left: 50%;
margin-left: -15px;
border-left: 15px solid transparent;
border-right: 15px solid transparent;
border-top: 15px solid rgba(0,0,0,0.3);
}
<div id="nav">
<ul id="menu">
<li><a class="link" href="#home">Home</a></li>
<li><a class="link" href="#about">About</a></li>
<li><a class="link" href="#skills">Skills</a></li>
<li><a class="link" href="#portfolio">Portfolio</a></li>
<li style="float:right"><a class="link" href="#contact">Contact</a></li>
</ul>
</div>
The arrow is always showing up in the middle of the navigation bar. This is because of the left: 50% code. I think it's doing this because it's getting 50% from the wrong element but I don't know how to fix it. Any help would be great.
Positioning can sometimes be a little tricky. You need to position the parent (<a>: position: relative;), so that the positioning of the arrow is calculated relative to the link.
To set the arrows down under the bar, you have to use bottom minus the height of the arrow: bottom: -15px;. I had to remove your overflow:hidden; and put an element with clear:both; after the <li> tags, to make them visible, because your <ul>s height was zero with only containing floating elements.
ul {
background: rgba(0, 0, 0, 0.3);
list-style-type: none;
padding: 0;
margin: 0;
}
li {
display: block;
float: left;
}
li a {
display: block;
color: white;
text-align: center;
padding: 16px 16px;
text-decoration: none;
-webkit-transition: color 0.5s ease-in;
position: relative;
}
li a:visited {
color: white;
}
li a:hover {
color: #df9fa2;
}
#menu a:hover:after {
content: "";
position: absolute;
bottom: -15px;
width: 0px;
left: 50%;
margin-left: -15px;
border-left: 15px solid transparent;
border-right: 15px solid transparent;
border-top: 15px solid rgba(0, 0, 0, 0.3);
}
<div id="nav">
<ul id="menu">
<li><a class="link" href="#home">Home</a>
</li>
<li><a class="link" href="#about">About</a>
</li>
<li><a class="link" href="#skills">Skills</a>
</li>
<li><a class="link" href="#portfolio">Portfolio</a>
</li>
<li style="float:right;"><a class="link" href="#contact">Contact</a>
</li>
<br style="clear:both;" />
</ul>
</div>
Just read some examples about positioning in CSS:
http://www.w3schools.com/css/css_positioning.asp

Trouble aligning child menus with parent items

Hi im trying to create a navigation bar which when you hover the li another list come out from the side to show other options. My problem I can get to align with the first li but I'm not sure how to do it with the rest of the list. At the moment the drop down list stays in the same position.
Im sure I haven't explained it well enough here is my code.
<body class="menu">
<header>
<nav class="menu-side">
<ul>
<li class="icon-home"><span>Home</span></li>
<li class="arrow"> <a class="star" href="#">England</a>
<ul>
<li><a class="ee" href="Premiership.html">Premiership</a>
</li>
<li>Championship
</li>
<li>League 1
</li>
<li>League 2
</li>
</ul>
</li>
<li class="arrow"> France
<ul >
<li id="r"><a class="ee" href="Unavailble.html">Ligue 1</a>
</li>
</ul>
</li>
<li class="arrow"> Germany
<ul>
<li><a class="ee" href="Unavailble.html">Bundesliga</a>
</li>
</ul>
</li>
<li class="arrow"> Italy
<ul>
<li><a class="ee" href="Unavailble.html">Serie A</a>
</li>
</ul>
</li>
<li class="arrow"> Spain
<ul>
<li><a class="ee" href="Unavailble.html">La Liga</a>
</li>
</ul>
</li>
</ul>
</nav>
</header>
</body>
https://jsfiddle.net/2zov6q2v/
Change margin of your lists:
nav ul ul {
height: auto;
display: none;
position:absolute;
background-color: #399077;
margin-left: 89.5%;
//top: 9%; delete this line
margin-top: -38px; //add this line
z-index:150;
}
jsfiddle
.menu {
position: relative;
left: 0;
}
.menu-open {
left: 0;
}
.menu-open .menu-side {
left: 0;
}
.menu-side,
menu {
-webkit-transition: left 0.2s ease;
-moz-transition: left 0.2s ease;
transition: left 0.2s ease;
}
.menu-side {
background-color: #333;
color: #fff;
position: fixed;
top: 0;
left: 0;
width: 210px;
height: 100%;
padding: 2px;
}
body {
display: block;
margin: 8px;
background: #f0f0f0;
}
nav ul {
background-color: #43a286;
/* overflow: hidden; <----------------- here */
color: white;
padding: 0;
text-align: center;
margin: 0;
width: 100%;
height: 100%;
-webkit-transition: max-height 0.4s;
-ms-transition: max-height 0.4s;
-moz-transition: max-height 0.4s;
-o-transition: max-height 0.4s;
transition: max-height 0.4s;
}
nav ul li {
display: block;
padding: 20px;
width: 80%;
text-align: center;
position: relative; /* <------------------ and here */
}
nav ul li:hover {
background-color: #399077;
}
nav ul .arrow:hover {
border-right: 10px solid white;
border-right-width: thick;
width: 79%;
}
nav ul ul {
height: auto;
display: none;
position: absolute;
background-color: #399077;
left: 89.5%;
top: 9%;
z-index: 150;
}
nav ul ul li {
display: block;
width: 75%;
text-align: center;
}
nav ul li:hover ul {
display: block;
width: 165px;
}
/*nav .ee:after {
content: '';
width: 0;
height: 0;
border-top: 8px solid black;
border-right: 8px solid transparent;
border-left: 8px solid transparent;
position: absolute;
z-index: 1;
top: 0%;
left: 50%;
margin-left: -6px
} */
nav ul li a,
visited {
color: white;
font-family: 'CFJackStory-Regular', Helvetica, Arial, sans-serif;
display: block;
text-decoration: none;
}
nav ul ul li a:hover {
color: white;
font-size: 20px;
}
<body class="menu">
<header>
<nav class="menu-side">
<ul>
<li class="icon-home"><span>Home</span>
</li>
<li class="arrow"> <a class="star" href="#">England</a>
<ul>
<li><a class="ee" href="Premiership.html">Premiership</a>
</li>
<li>Championship
</li>
<li>League 1
</li>
<li>League 2
</li>
</ul>
</li>
<li class="arrow"> France
<ul>
<li id="r"><a class="ee" href="Unavailble.html">Ligue 1</a>
</li>
</ul>
</li>
<li class="arrow"> Germany
<ul>
<li><a class="ee" href="Unavailble.html">Bundesliga</a>
</li>
</ul>
</li>
<li class="arrow"> Italy
<ul>
<li><a class="ee" href="Unavailble.html">Serie A</a>
</li>
</ul>
</li>
<li class="arrow"> Spain
<ul>
<li><a class="ee" href="Unavailble.html">La Liga</a>
</li>
</ul>
</li>
</ul>
</nav>
</header>
</body>
Change this style
.menu{
position: relative;
left: 0;
}
.menu-open{
left: 0;
}
.menu-open .menu-side{
left: 0;
}
.menu-side, menu {
-webkit-transition: left 0.2s ease;
-moz-transition: left 0.2s ease;
transition: left 0.2s ease;
}
.menu-side{
background-color: #333;
color: #fff;
position: fixed;
top: 0;
left: 0;
width: 210px;
height: 100%;
padding: 2px;
}
body{
display: block;
margin: 8px;
background: #f0f0f0;
}
nav ul{
background-color: #43a286;
color:white;
padding: 0;
text-align: center;
margin: 0;
width: 100%;
height: 100%;
-webkit-transition: max-height 0.4s;
-ms-transition: max-height 0.4s;
-moz-transition: max-height 0.4s;
-o-transition: max-height 0.4s;
transition: max-height 0.4s;
}
nav ul li{
display: block;
padding: 20px;
width: 80%;
text-align: center;
position: relative;
}
nav ul li:hover {
background-color: #399077;
}
nav ul .arrow:hover{
border-right: 10px solid white;
border-right-width: thick;
width: 79%;
}
nav ul ul {
height: auto;
display: none;
background-color: #399077;
left: 212px;
position: absolute;
top: 0;
z-index:150;
}
nav ul ul li{
display: block;
width:75%;
text-align: center;
}
nav ul li:hover ul{
display: block;
width: 165px;
}
/*nav .ee:after {
content: '';
width: 0;
height: 0;
border-top: 8px solid black;
border-right: 8px solid transparent;
border-left: 8px solid transparent;
position: absolute;
z-index: 1;
top: 0%;
left: 50%;
margin-left: -6px
} */
nav ul li a, visited{
color:white;
font-family: 'CFJackStory-Regular', Helvetica, Arial, sans-serif;
display: block;
text-decoration: none;
}
nav ul ul li a:hover{
color:white;
font-size: 20px;
}
<body class="menu">
<header>
<nav class="menu-side">
<ul>
<li class="icon-home"><span>Home</span></li>
<li class="arrow"> <a class="star" href="#">England</a>
<ul>
<li><a class="ee" href="Premiership.html">Premiership</a>
</li>
<li>Championship
</li>
<li>League 1
</li>
<li>League 2
</li>
</ul>
</li>
<li class="arrow"> France
<ul >
<li id="r"><a class="ee" href="Unavailble.html">Ligue 1</a>
</li>
</ul>
</li>
<li class="arrow"> Germany
<ul>
<li><a class="ee" href="Unavailble.html">Bundesliga</a>
</li>
</ul>
</li>
<li class="arrow"> Italy
<ul>
<li><a class="ee" href="Unavailble.html">Serie A</a>
</li>
</ul>
</li>
<li class="arrow"> Spain
<ul>
<li><a class="ee" href="Unavailble.html">La Liga</a>
</li>
</ul>
</li>
</ul>
</nav>
</header>
</body>
See this updated JSFiddle. Set li's to position: relative; and ul ul's to position: absolute. From there you can set ul ul's left to 100%. This pushes them all the way to the right of the parent. You can use left: calc(100% + 5px) to account for li's white right border when hovered. No need for messy margins.

Navigation submenu switches to other submenu on hover

I have a navigation menu that I'm trying to get to work, but the submenus keep switching to another submenu whenever I hover over it. How can I get it so that the right menu stays up when I hover over it?
jsfiddle: http://jsfiddle.net/SHQwm/
.hoverBar {
position: relative;
border: 1px solid #d6d6d6;
background: #fff;
padding: 15px 20px;
height: 100px;
}
ul {
margin: 0;
padding: 0;
width: 1152px;
}
.mainmenu > li {
list-style: none;
float:left;
text-align: center;
}
ul.mainmenu > li a {
font-family: 'Open Sans', sans-serif;
padding: 0 10px;
font-size: 11px;
text-decoration: none;
text-transform: uppercase;
}
ul li ul {
opacity: 0;
transition: opacity .15s ease-in-out;
-moz-transition: opacity .15s ease-in-out;
-webkit-transition: opacity .15s ease-in-out;
-o-transition: opacity .15s ease-in-out;
list-style-type: none;
text-align: left;
float: left;
width: 100%;
position: absolute;
z-index: 60;
left: 0;
padding-top: 30px;
}
ul li:hover ul {
opacity: 1;
}
ul li ul li {
float: left;
text-align: left;
border-top: #4c4c4c 1px solid;
border-bottom: #303030 1px solid;
border-radius: 2px;
margin-bottom: 0;
padding: 10px 0;
white-space: nowrap;
width: auto;
}
ul li ul li:hover {
background-color: #008000;
}
.floatr {
position: absolute;
top: 10px;
z-index: 50;
width: 100px;
height: 30px;
background : #ebebeb;
opacity: 0.25;
-ms-transition: all .4s ease-in-out;
-webkit-transition: all .4s ease-in-out;
-moz-transition: all .4s ease-in-out;
border-top: solid 1px #00aced;
border-bottom: solid 1px #00aced;
}
.mainmenu > li:hover > a {
opacity: 1;
}
ul li ul li a {
display: block;
padding: 0px;
line-height: 14px;
font-size: 12px;
color: #000;
font-family: 'Open Sans', sans-serif;
text-transform: none !important;
text-align: left;
}
ul li:hover ul li {
display:block;
}
.mainmenu {
height: 100px;
}
#jobBank {
left: 450;
width: 210px;
}
And the HTML:
<nav class="head_nav">
<div class="hoverBar" >
<ul class="mainmenu">
<li class="active">About
<ul style="background-color: red;">
<li>Mission</li>
<li>Board Members</li>
<li>Staff</li>
<li>Members</li>
<li>Task Forces</li>
</ul>
</li>
<li>Events
<ul style="background-color: green;">
<li>Description</li>
<li>Registration with Outlook ICS</li>
<li>Online Payment</li>
<li>Email auto-reminders</li>
<li>Multiple registrants allowed</li>
</ul>
</li>
<li>Galleries
<ul style="background-color: blue;">
<li>EXAMPLE: Executive Board</li>
<li>EXAMPLE: Single Page or Blog Page</li>
<li>EXAMPLE: Photo Gallery</li>
</ul>
</li>
<li>Educational Resources</li>
<li>Economic Development
<ul style="background-color: yellow;">
<li>Major Corporations/Global Businesses</li>
<li>Maps</li>
<li>Available Properties</li>
<li>Communities Represented</li>
<li>Demographics</li>
<li>Workforce</li>
<li>Taxes</li>
<li>Transportation</li>
<li>Utilities</li>
<li>Incentives & Financing</li>
<li>Report and Publications</li>
</ul>
</li>
</li>
<li>Media Room
<ul>
<li class="first">Press Releases</li>
<li>Media Kit Information</li>
<li>Blog</li>
<li>Link to Logo & Standards</li>
<li>Link to Photo Gallery</li>
<li>Twitter, Facebook, LinkedIn, Flickr</li>
<li>Speakers Bureau List/info</li>
<li>Fact Sheet</li>
<li class="last">Media Relations Contact</li>
</ul>
</li>
<li>Job Bank
<ul id="jobBank">
<li class="first">Member Add/Edit/Delete</li>
<li class="last">Time Expire</li>
</ul>
</li>
</ul>
<div class="floatr"></div>
</div>
</nav>
Remove opacity: 0 from ul li ul. Replace it with display: none;. Remove opacity: 1 from ul li:hover ul. Replace it with display: block;. Currently, all of the subnavigations are there, you just can't see them. Setting them to display: none; by default will only display the correct one when the parent navigation element is hovered and will remove the issue you're having. http://jsfiddle.net/SHQwm/5/