Multilevel dropdown menu won't go to the right - html

I have ran into a slight problem with my dropdown menu. I need and extra level in my dropdown, but i really don't know what to do with the CSS...
The page can be seen here.
The problem can be seen in the menu under "Om os", where "Brochure 2013", "Brochure 2014" should be visible when hovering over "Brochure" and not as it is now!
How to fix this?
Here's my CSS:
.cssmenu {
border: 0px solid #2E181A;
margin: 0px auto 0px auto;
padding: 0px;
font-family: verdana,geneva,arial,helvetica,sans-serif;
font-size: 14px;
font-weight: bold;
color: #2E181A;
width: 798px;
background: #E6D9BD;
text-align: center;
}
.cssmenu ul {
background: #E6D9BD;
height: 37px;
list-style: none;
margin: 0px auto 0px auto;
padding: 0;
text-align: center;
}
.cssmenu li {
padding: 0px 8px 0px 8px;
display: inline-block;
}
.cssmenu li a {
color: #2E181A;
display: block;
font-weight: bold;
line-height: 37px;
padding: 0px 10px;
text-align: center;
text-decoration: none;
}
.cssmenu li a:hover {
color: #8e8e8e;
text-decoration: none;
}
.cssmenu li ul {
background: #E6D9BD;
border-left: 5px solid #2E181A;
border-right: 5px solid #2E181A;
border-bottom: 5px solid #2E181A;
display: none;
height: auto;
opacity: 0.95;
filter: alpha(opacity=95);
/* For IE8 and earlier */
position: absolute;
width: 225px;
z-index: 200;
float: none;
/*top:1em;
/*left:0;*/;
}
.cssmenu li:hover ul {
display: block;
}
.cssmenu li li {
display: block;
float: none;
padding: 0px;
width: 225px;
}
.cssmenu li ul a {
display: block;
font-size: 12px;
font-style: normal;
padding: 0px 25px 0px 25px;
text-align: left;
}
.cssmenu li ul a:hover {
background: #D5BE91;
color: #000000;
opacity: 1;
filter: alpha(opacity=100);
/* For IE8 and earlier */;
}
.cssmenu p {
clear: left;
}
.cssmenu .active > a {
background:;
color: #ffffff;
}
.cssmenu .active > a:hover {
color: #ffffff;
}
And here's my menu:
<ul class="active">
<li><span>Forside</span>
</li>
<li><span>Hingste</span>
<ul>
<li><span>Volstrups Cash</span>
</li>
<li><span>Churchill</span>
</li>
<li><span>Blejsbjergs Cooper</span>
</li>
<li><span>Con Cosmos</span>
</li>
</ul>
</li>
<li><span>Salgsheste</span>
<ul>
<li><span>Volstrups Charline</span>
</li>
<li><span>Volstrups Calina</span>
</li>
<li><span>Volstrups Colline</span>
</li>
</ul>
</li>
<li><span>Betingelser</span>
</li>
<li><span>Om os</span>
<ul>
<li><span>Heste på stationen</span>
</li>
<li><span>Samarbejdspartnere</span>
</li>
<li><span>Om Stutteriet</span>
</li>
<li><span>Brochure</span>
<ul>
<li><span>Brochure for 2014</span>
</li>
<li><span>Brochure for 2013</span>
</li>
</ul>
</li>
</ul>
</li>
Hope you guys can help me out! :)

you need woking with level3 ul.add some margin-top andleft to 100%
just add this porperty to you css file:
.cssmenu li li:hover > ul{
visibility:visible !important
}
.cssmenu li ul ul {
margin-top: -30px;
left: 100%;
width: 100%;
visibility:hidden;
border-left:none;
margin-left:-5px;
}
.cssmenu li ul ul a{
border-left:5px solid #2E181A;
}
.cssmenu li ul ul li:first-child a{
border-left:none !important;
}
also you don't need add the <a> tag into <span>. you can remove that,

Related

Displaying a sub-sub-menu on hover of menu with CSS

I need to display sub-sub-menu on hover of my sub-menu. So far I did code to display menu -> sub-menu on menu click, but to proceed I want a functionality to display sub-sub-menu on hover of my sub-menu. Can somebody help me to achieve the same?
var ddmenuitem = 0;
function jsddm_open() {
jsddm_close();
ddmenuitem = $(this).find('ul.submenu').css('display', 'block');
// $(this).find('div.subsubmenu').css('display','none');
}
function jsddm_close() {
if (ddmenuitem) ddmenuitem.css('display', 'none');
}
$(document).ready(function() {
$('#topnav > ul > li').bind('click', jsddm_open)
$('#topnav > ul > li > a').click(function(ev) {
if ($(this).hasClass('current')) {
ev.preventDefault();
}
if ($(this).attr('class') != 'active') {
$('#topnav ul li a').removeClass('active');
$(this).addClass('active');
}
});
});
#topnav {
float: left;
width: 600px;
height: 30px;
background: black;
margin-top: 10px;
position: relative;
font-size: 15px;
margin-left: 30px
}
#topnav ul {
list-style: none;
padding: 0px;
margin: 0px;
}
#topnav ul li {
float: left;
margin: 0;
padding: 0;
}
#topnav ul li a {
padding: 5px 15px;
color: red;
text-decoration: none;
display: block;
font-weight: bold;
}
#topnav ul li a:link {
color: red;
text-decoration: none;
}
#topnav ul li a:visited {
color: #FFF;
text-decoration: none;
}
#topnav ul li a:hover {
color: red;
text-decoration: none;
}
#topnav ul li a.active {
text-decoration: none;
color: black;
background: #e0e0e0;
}
#topnav ul li ul.submenu {
float: left;
padding: 4px 0;
position: absolute;
left: 0;
top: 30px;
display: none;
background: #e0e0e0;
color: #00537F;
width: 600px;
height: 30px;
}
#topnav ul li ul.submenu a {
display: inline;
color: #00537F;
padding: 4px 8px;
}
#topnav ul.submenu a:hover {
background-color: black;
color: white;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div id="topnav">
<ul>sds
<li>
Admin
</li>
<li>
MAC
<ul class="submenu">
<li>Master Data</li>
<li>
Transaction Data
<ul>
<li>Company Master</li>
<li>Location Master</li>
<li>Size Master</li>
</ul>
</li>
<li>
Admin Data
</li>
</ul>
</li>
</ul>
</div>
Try the following snippet without using jquery or javascript, you can get it done using only css. And have updated according to your question
#nav {
list-style: none inside;
margin: 0;
padding: 0;
text-align: center;
}
#nav li {
display: block;
position: relative;
float: left;
background: #000000;
}
#nav li a {
display: block;
padding: 0;
text-decoration: none;
width: 200px;
line-height: 35px;
color: #fff;
}
#nav li li a {
font-size: 80%;
}
#nav li:hover {
background: #ff0000;
}
#nav ul {
position: absolute;
padding: 0;
left: 0;
display: none;
}
#nav li:hover ul ul {
display: none;
}
#nav li:hover ul {
display: block;
}
#nav li li:hover ul {
display: block;
margin-left: 200px;
margin-top: -35px;
}
<div id="topnav">
<ul id="nav">
<li>
Admin
</li>
<li>
MAC
<ul class="submenu">
<li>Master Data</li>
<li>
Transaction Data ⇒
<ul>
<li>Company Master</li>
<li>Location Master</li>
<li>Size Master</li>
</ul>
</li>
<li>
Admin Data
</li>
</ul>
</li>
</ul>
</div>
you can try this
#menu {
background: #343434;
color: #eee;
height: 35px;
border-bottom: 4px solid #eeeded
}
#menu ul,
#menu li {
margin: 0 0;
padding: 0 0;
list-style: none
}
#menu ul {
height: 35px
}
#menu li {
float: left;
display: inline;
position: relative;
font: bold 12px Arial;
text-shadow: 0 -1px 0 #000;
border-right: 1px solid #444;
border-left: 1px solid #111;
text-transform: uppercase
}
#menu li:first-child {
border-left: none
}
#menu a {
display: block;
line-height: 35px;
padding: 0 14px;
text-decoration: none;
color: #eee;
}
#menu li:hover > a,
#menu li a:hover {
background: #111
}
#menu input {
display: none;
margin: 0 0;
padding: 0 0;
width: 80px;
height: 35px;
opacity: 0;
cursor: pointer
}
#menu label {
font: bold 30px Arial;
display: none;
width: 35px;
height: 36px;
line-height: 36px;
text-align: center
}
#menu label span {
font-size: 12px;
position: absolute;
left: 35px
}
#menu ul.menus {
height: auto;
width: 180px;
background: #111;
position: absolute;
z-index: 99;
display: none;
border: 0;
}
#menu ul.menus li {
display: block;
width: 100%;
font: 12px Arial;
text-transform: none;
}
#menu li:hover ul.menus {
display: block
}
#menu a.home {
background: #c00;
}
#menu a.prett {
padding: 0 27px 0 14px
}
#menu a.prett::after {
content: "";
width: 0;
height: 0;
border-width: 6px 5px;
border-style: solid;
border-color: #eee transparent transparent transparent;
position: absolute;
top: 15px;
right: 9px
}
#menu ul.menus a:hover {
background: #333;
}
#menu ul.menus .submenu {
display: none;
position: absolute;
left: 180px;
background: #111;
top: 0;
width: 180px;
}
#menu ul.menus .submenu li {
background: #111;
}
#menu ul.menus .has-submenu:hover .submenu {
display: block;
}
<nav>
<ul id='menu'>
<li><a class='home' href='/'>Home</a></li>
<li><a class='prett' href='#' title='Menu'>Menu</a>
<ul class='menus'>
<li class='has-submenu'><a class='prett' href='Dropdown 1' title='Dropdown 1'>Dropdown 1 + Sub Menu</a>
<ul class='submenu'>
<li>Sub Menu</li>
<li>Sub Menu 2</li>
<li>Sub Menu 3</li>
</ul>
</li>
<li><a href='#' title='Dropdown 2'>Dropdown 2</a></li>
<li><a href='#' title='Dropdown 3'>Dropdown 3</a></li>
</ul>
</li>
</ul>
</nav>

Blogger Drop Down Menu Issue

When you click on links in my drop-down menu, the URL just keeps adding the next url/page to the previous one. Below is my code and a screenshot of the issue. What am I doing wrong?
#menubar {
background: #00ffffff;
width: 840px;
color: #FFF;
margin: 0px;
padding: 0;
position: relative;
border-top: 0px solid #B2FFFF;
height: 35px;
}
#menus {
margin: 0;
padding: 0;
}
#menus ul {
float: left;
list-style: none;
margin: 0;
padding: 0;
}
#menus li {
list-style: none;
margin-bottom: 10px;
padding-bottom: 0px;
border-left: 1px solid #D3D3D3;
border-right: 1px solid #D3D3D3;
height: 35px;
}
#menus li a,
#menus li a:link,
#menus li a:visited {
color: #000;
display: block;
font: normal 20px Bradley Hand ITC, Book Antiqua, Century Gothic, Harlow Solid Italic, Arial Unicode MS;
margin: 0;
padding: 9px 12px 10px 12px;
text-decoration: none;
}
#menus li a:hover,
#menus li a:active {
background: #130000;
/* Menu hover */
color: #FFF;
display: block;
text-decoration: none;
margin: 0;
padding: 9px 12px 10px 12px;
}
#menus li {
float: left;
padding: 0;
}
#menus li ul {
z-index: 9999;
position: absolute;
left: -999em;
height: auto;
width: 160px;
margin: 0;
padding: 0;
}
#menus li ul a {
width: 140px;
}
#menus li ul ul {
margin: -25px 0 0 160px;
}
#menus li:hover ul ul,
#menus li:hover ul ul ul,
#menus li.sfhover ul ul,
#menus li.sfhover ul ul ul {
left: -999em;
}
#menus li:hover ul,
#menus li li:hover ul,
#menus li li li:hover ul,
#menus li.sfhover ul,
#menus li li.sfhover ul,
#menus li li li.sfhover ul {
left: auto;
}
#menus li:hover,
#menus li.sfhover {
position: static;
}
#menus li li a,
#menus li li a:link,
#menus li li a:visited {
background: #00FFFF;
/* drop down background color */
width: 120px;
color: #FFF;
display: block;
font: normal 20px Bradley Hand ITC, Book Antiqua, Century Gothic, Harlow Solid Italic, Arial Unicode MS;
margin: 0;
padding: 9px 12px 10px 12px;
text-decoration: none;
z-index: 9999;
border-bottom: 1px solid #1A6680;
}
#menus li li a:hover,
#menus li li a:active {
background: #130000;
/* Drop down hover */
color: #FFF;
display: block;
margin: 0;
padding: 9px 12px 10px 12px;
text-decoration: none;
}
<div id='menubar'>
<ul id='menus'>
<li>
<a href='gilbertlzrus.blogspot.com'>Home</a>
</li>
<li>
<a href='search/label/Posts'>Posts</a>
<ul>
<li><a href='search/label/FKUI'>FK UI</a></li>
<li><a href='search/label/Articles'>Articles</a></li>
<li><a href='search/label/Download'>Download</a></li>
</ul>
</li>
<li>
<a href='#'>About Me</a>
</li>
</ul>
</div>
Notice the URL here:
Your links are with a relative path, meaning that the part in href="..." will be added to the current address in the browser.
Change the href="..." to this:
<div id='menubar'>
<ul id='menus'>
<li>
Home
</li>
<li>
Posts
<ul>
<li>FK UI</li>
<li>Articles</li>
<li>Download</li>
</ul>
</li>
<li>
<a href='#'>About Me</a>
</li>
</ul>
</div>
a / at the beginning means that the link will start at the domain.
// Examples:
// href="/" => http(s)://CURRENT_DOMAIN/
// href="/search/label/FKUI" => http(s)://CURRENT_DOMAIN/search/label/FKUI
// href="search/label/FKUI" => http(s)://CURRENT_DOMAIN/CURRENT_PATH/search/label/FKUI
Add this Code to you website
#import url(http://fonts.googleapis.com/css?family=Montserrat);
#import url(https://fonts.googleapis.com/icon?family=Material+Icons);
* {
margin: 0;
padding: 0;
}
.nav {
background: #232323;
height: 60px;
display: inline-block;
}
.nav li {
float: left;
list-style-type: none;
position: relative;
}
.nav li a {
font-size: 16px;
color: white;
display: block;
line-height: 60px;
padding: 0 26px;
text-decoration: none;
border-left: 1px solid #2e2e2e;
font-family: Montserrat, sans-serif;
text-shadow: 0 0 1px rgba(255, 255, 255, 0.5);
}
.nav li a:hover {
background-color: #2e2e2e;
}
#settings a {
padding: 18px;
height: 24px;
font-size: 10px;
line-height: 24px;
}
::-webkit-input-placeholder { /* WebKit browsers */
color: white;
}
:-moz-placeholder { /* Mozilla Firefox 4 to 18 */
color: white;
}
::-moz-placeholder { /* Mozilla Firefox 19+ */
color: white;
}
:-ms-input-placeholder { /* Internet Explorer 10+ */
color: white;
}
#options a{
border-left: 0 none;
}
#options>a {
background-image: url(triangle.png);
background-position: 85% center;
background-repeat: no-repeat;
padding-right: 42px;
}
.subnav {
visibility: hidden;
position: absolute;
top: 110%;
right: 0;
width: 200px;
height: auto;
opacity: 0;
transition: all 0.1s;
background: #232323;
}
.subnav li {
float: none;
}
.subnav li a {
border-bottom: 1px solid #2e2e2e;
}
#options:hover .subnav {
visibility: visible;
top: 100%;
opacity: 1;
}
<ul class="nav">
<li id="settings">
<i class="material-icons" style="font-size:25px;line-height: 25px;">home</i>
</li>
<li>
<a href='search/label/Posts'>Posts</a>
</li>
<li id="options">
<a href='search/label/Posts'>Posts</a>
<ul class="subnav">
<li><a href='search/label/FKUI'>FK UI</a></li>
<li><a href='search/label/Articles'>Articles</a></li>
<li><a href='search/label/Download'>Download</a></li>
</ul>
</li>
<li>
<a href='#'>About Me</a>
</li>
</ul>

how to add drop-down menu?

I have horizontal menu bar, and I trying to add sub menu for one of item, but I am not able to add it, Its appending to my main menu, please someone help me to where i missing
thanks
HTML
<div id="talltabs-maroon">
<ul>
<li class="first">Home <span>Page</span></li>
<li class="active"><span>About us</span></li>
<li class="dropdown"><a class="dropbtn" href="#"> <span> Report </span></a>
<ul class="dropdown-content" style="left:0">
<li>
<a href="">
<p>Valve Report</p>
</a>
</li>
<li>
<a href="">
<p>Cylinder Report</p>
</a>
</li>
</ul>
</li>
<li class="last">Contact <span>Us</span></li>
</ul>
</div>
CSS for Main menu
#talltabs-maroon {
clear: left;
float: left;
padding: 0;
border-top: 3px solid #CD324F;
width: 100%;
overflow: hidden;
font-family: Georgia, serif;
height: 90px;
position: inherit;
}
#talltabs-maroon ul {
float: left;
margin: 0;
padding: 0;
list-style: none;
position: relative;
left: 50%;
text-align: center;
}
#talltabs-maroon ul li {
display: block;
float: left;
list-style: none;
margin: 0;
padding: 0;
position: relative;
right: 50%;
}
#talltabs-maroon ul li a {
display: block;
float: left;
margin: 0 3px 0 0;
padding: 0px 10px 6px 10px;
background: #CD324F;
text-decoration: none;
color: #fff;
}
#talltabs-maroon ul li a p:hover {
color: aqua;
}
#talltabs-maroon ul li a:hover {
padding: 20px 10px 6px 10px;
color: black
}
#talltabs-maroon ul li.active a,
#talltabs-maroon ul li.active a:hover {
padding: 25px 10px 6px 10px;
border-width: 5px;
border-color: aqua;
color: aqua;
}
CSS for drop down menu i tried.
.dropbtn {
list-style-type: none;
color: white;
padding: 14px;
font-size: 14px;
border: none;
cursor: pointer;
}
.dropdown {
position: relative;
display: block;
}
.dropdown-content {
list-style-type: none;
display: none;
position: absolute;
right: 0;
/*background-color: black;*/
background-image: url('../../Images/black-olive.jpg'); /*dropdowm popup*/
min-width: 160px;
box-shadow: 0px 8px 16px 5px rgba(0,0,0,0.2);
z-index: 1;
padding-right: 2px;
margin-right: 2px;
}
.dropdown-content a {
color: white;
padding: 10px 14px;
text-decoration: none;
display: block;
}
.dropdown-content a:hover {
/*background-color: gray;*/
color: black;
}
.dropdown:hover .dropdown-content {
display: block;
}
.dropdown:hover .dropbtn {
/*background-color: #3e8e41;*/
}
pleas help me.
thanks
tink.
Here is my answer for same example, I changed complete css,
body {
font-family: 'Lucida Grande', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}
ul {
text-align: left;
display: inline;
margin: 0;
padding: 15px 4px 17px 0;
list-style: none;
}
ul li {
display: inline-block;
margin-right: -1px;
position: relative;
padding: 15px 20px;
background: #CD324F;
cursor: pointer;
color: black;
height: 40px;
width: auto;
text-align:center;
}
ul li a{
color:black;
}
ul li:hover {
background: #CD324F;
color: #fff;
height: 45px;
}
ul li a:hover {
color: #fff;
}
ul li ul {
padding: 0;
position: absolute;
top: 68px;
left: 0;
width: 160px;
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none;
display: none;
opacity: 0;
visibility: hidden;
}
ul li ul li {
background: #ce5068;
display: block;
color: #CD324F;
height: 35px;
}
ul li ul li:hover {
background: #CD324F;
height: 35px;
}
ul li:hover ul {
display: block;
opacity: 1;
visibility: visible;
}
<div style="height: 77px; width:100%; margin-top:65px;text-align:center; border-top:solid; border-top-color:#CD324F">
<ul><li>Home</li>
<li>About</li>
<li>
Portfolio
<ul>
<li>Web Design</li>
<li>Web Development</li>
<li>Illustrations</li>
</ul>
</li>
<li>Blog</li>
<li>Contact</li>
</ul>
</div>
Result: on hover portfolio, drop down will appear
Working example on JSFiddle.
I really recommend to look at bootstrap's drop down menu. It is easy to use and most things are already done for you. good luck
Here is the link: https://www.w3schools.com/bootstrap/bootstrap_dropdowns.asp
your code is bit confusing , i have created a simple demo for you how to do it.
here is my HTML code
body {
background: #212121;
font-size:22px;
line-height: 32px;
color: #ffffff;
word-wrap:break-word !important;
font-family: 'Open Sans', sans-serif;
}
h1 {
font-size: 60px;
text-align: center;
color: #FFF;
}
h3 {
font-size: 30px;
text-align: center;
color: #FFF;
}
h3 a {
color: #FFF;
}
a {
color: #FFF;
}
h1 {
margin-top: 100px;
text-align:center;
font-size:60px;
font-family: 'Bree Serif', 'serif';
}
#container {
margin: 0 auto;
}
p {
text-align: center;
}
nav {
margin: 50px 0;
background-color: #E64A19;
}
nav ul {
padding: 0;
margin: 0;
list-style: none;
position: relative;
}
nav ul li {
display:inline-block;
background-color: #E64A19;
}
nav a {
display:block;
padding:0 10px;
color:#FFF;
font-size:20px;
line-height: 60px;
text-decoration:none;
}
nav a:hover {
background-color: #000000;
}
/* Hide Dropdowns by Default */
nav ul ul {
display: none;
position: absolute;
top: 60px; /* the height of the main nav */
}
/* Display Dropdowns on Hover */
nav ul li:hover > ul {
display:inherit;
}
/* Fisrt Tier Dropdown */
nav ul ul li {
width:170px;
float:none;
display:list-item;
position: relative;
}
<div id="container">
<nav>
<ul>
<li>Home</li>
<li>WordPress
<!-- First Tier Drop Down -->
<ul>
<li>Themes</li>
<li>Plugins</li>
<li>Tutorials</li>
</ul>
</li>
<li>Web Design
<!-- First Tier Drop Down -->
<ul>
<li>Resources</li>
<li>Links</li>
<li>Tutorials
</ul>
</nav>
</div>

Drop down menu drop vertically on the link

This must be basic to some but not to all new CSS members. Quick one how do I have the drop down menu drop on the same link not as in line? I want it to drop vertically on the same place not to extend in line. Any one?
.nav-container {
float: center;
width: 100%;
padding-bottom: 0;
margin-bottom: 11px;
}
.navigation-menu {
padding: 0;
float: center;
clear: both;
font-size: 12px
margin-bottom: 0;
}
.navigation-menu > li {
margin-right: 3px;
margin: 100px auto;
line-height:20px;
max-width:860px;
display: inline;
}
.navigation-menu li {
list-style-type: none;
}
.navigation-menu li a {
background-color: #ffffff;
display:inline-block;
padding: 10px 20px;
color: #696969;
text-decoration: none;
border-radius: 4px 4px 0 0;
}
.navigation-menu li.active a {
background-color: purple;
color:#fff;
}
.navigation-menu li ul {
display: none;
}
.navigation-menu ul li a{
padding:10px 20px;
}
#main {
clear: left;
}
.navigation-menu li:hover ul {
display: inline-block;
position: absolute;
padding:5px;
}
.navigation-menu li ul li a:hover{
background-color: black;
color: white;
display: block;
}
.navigation-menu li a:hover{
background-color:black;
color: white;
}
.navigation-menu li a:active {
background-color: purple;
color:#fff;
}
.navigation-menuul li ul li {
background: #555;
display: block;
color: #fff;
text-shadow: 0 -1px 0 #000;
}
<div class="nav-container">
<ul class="navigation-menu">
<li><a href='#' >Home</a></li>
<li class="active"><a href='#' >C2B Payments</a> </li>
<li><a href='#' >C2B SMS</a>
<ul>
<li> C2B SMS</li>
<li> Send SMS</li>
<li> Campaign SMS</li>
</ul>
</li>
</ul>
</div>
Add this code .navigation-menu li { position: relative; } and also .navigation-menu li ul { display: none; position: absolute; left: 0; } to get the result of aligned dropdown
Add to this css in your file
.navigation-menu li:hover ul {
top: 100%;
left: 0;
}
.navigation-menu > li {
position: relative;
}
.nav-container {
float: center;
width: 100%;
padding-bottom: 0;
margin-bottom: 11px;
}
.navigation-menu li:hover ul {
top: 100%;
left: 0;
}
.navigation-menu > li {
position: relative;
}
.navigation-menu {
padding: 0;
float: center;
clear: both;
font-size: 12px
margin-bottom: 0;
}
.navigation-menu > li {
margin-right: 3px;
margin: 100px auto;
line-height:20px;
max-width:860px;
display: inline;
}
.navigation-menu li {
list-style-type: none;
}
.navigation-menu li a {
background-color: #ffffff;
display:inline-block;
padding: 10px 20px;
color: #696969;
text-decoration: none;
border-radius: 4px 4px 0 0;
}
.navigation-menu li.active a {
background-color: purple;
color:#fff;
}
.navigation-menu li ul {
display: none;
}
.navigation-menu ul li a{
padding:10px 20px;
}
#main {
clear: left;
}
.navigation-menu li:hover ul {
display: inline-block;
position: absolute;
padding:5px;
}
.navigation-menu li ul li a:hover{
background-color: black;
color: white;
display: block;
}
.navigation-menu li a:hover{
background-color:black;
color: white;
}
.navigation-menu li a:active {
background-color: purple;
color:#fff;
}
.navigation-menuul li ul li {
background: #555;
display: block;
color: #fff;
text-shadow: 0 -1px 0 #000;
}
<div class="nav-container">
<ul class="navigation-menu">
<li><a href='#' >Home</a></li>
<li class="active"><a href='#' >C2B Payments</a> </li>
<li><a href='#' >C2B SMS</a>
<ul>
<li> C2B SMS</li>
<li> Send SMS</li>
<li> Campaign SMS</li>
</ul>
</li>
</ul>
</div>
.nav-container {
float: center;
width: 100%;
padding-bottom: 0;
margin-bottom: 11px;
}
.navigation-menu {
padding: 0;
float: center;
clear: both;
font-size: 12px
margin-bottom: 0;
}
.navigation-menu > li {
margin-right: 3px;
margin: 100px auto;
line-height:20px;
max-width:860px;
display: inline;
}
.navigation-menu li {
list-style-type: none;
}
.navigation-menu li a {
background-color: #ffffff;
display:inline-block;
padding: 10px 20px;
color: #696969;
text-decoration: none;
border-radius: 4px 4px 0 0;
}
.navigation-menu li.active a {
background-color: purple;
color:#fff;
}
.navigation-menu li ul {
display: none;
position: relative;
top: 50px;
left: 215px;
}
.navigation-menu ul li a{
padding:10px 20px;
}
#main {
clear: left;
}
.navigation-menu li:hover ul {
display: inline-block;
position: absolute;
padding:5px;
}
.navigation-menu li ul li a:hover{
background-color: black;
color: white;
display: block;
}
.navigation-menu li a:hover{
background-color:black;
color: white;
}
.navigation-menu li a:active {
background-color: purple;
color:#fff;
}
.navigation-menuul li ul li {
background: #555;
display: block;
color: #fff;
text-shadow: 0 -1px 0 #000;
}
<div class="nav-container">
<ul class="navigation-menu">
<li><a href='#' >Home</a></li>
<li class="active"><a href='#' >C2B Payments</a> </li>
<li><a href='#' >C2B SMS</a>
<ul>
<li> C2B SMS</li>
<li> Send SMS</li>
<li> Campaign SMS</li>
</ul>
</li>
</ul>
</div>

Drop-down menu dissappears when you hover over the subcategories

In this site I have a drop-down menu that disappears when I try to hover over the subcategories. I found a fix - to change the 'top:_' information so that it overlaps. That works great, but it looks pretty ugly. I currently have it with a gap (which I want), if I hover quick enough I can get it to say, but that isn't particularly user friendly. I read somewhere that the border might be giving it the problems?
CSS code
#navigation {
height: 37px;
background-image: url(../images/background/navbar.jpg);
background-repeat: repeat-x;
background-position: left top;
padding-bottom: 8px;
padding-top: 8px;
}
.nav-container {
}
#nav {
float: left;
height: 37px;
font-size: 13px;
z-index: 998;
}
/* ALL Levels */ /* Style consistent throughout all nav levels */
#nav li {
position: relative;
text-align: left;
border-left-width: 1px;
border-left-style: solid;
border-left-color: #fff;
margin-left: 10px;
height: 21px;
left: -1px;
}
#nav a,
#nav a:hover {
display: block;
line-height: 1.3em;
text-decoration: none;
}
#nav span {
display: block;
cursor: pointer;
white-space: nowrap;
}
#nav li ul span {
white-space: normal;
}
/* 0 Level */
#nav li {
float: left;
margin: 0;
}
#nav a {
float: left;
color: #fff;
line-height: 21px;
padding-top: 0px;
padding-right: 12px;
padding-bottom: 0px;
padding-left: 12px;
margin-bottom: 8px;
}
#nav li.over a,
#nav a:hover, #nav li a:hover {
/*color:#444; text-shadow: 0px 1px #fff;*/;
}
#nav a:hover {
line-height: 21px;
}
#nav li:hover a {
/*color: #444 !important; text-shadow: 0px 1px #fff; */;
}
#nav li.over, #nav li:hover {
/*color: #444 !important;*/;
}
#nav li.active {
}
#nav li.active a {
/*color: #444 !important;text-shadow: 0px 1px #fff !important; */;
}
#nav li.home {
background: none;
padding-right: 0;
}
#nav li.home a {
padding-left: 10px;
}
/* 1st Level */
#nav ul li,
#nav ul li.active,
#nav ul li.over {
float: none;
border: none;
background: none;
margin: 0;
padding: 0;
text-transform: none;
height: 20px;
}
#nav ul li.parent {
background: url(../images/bkg_nav_parent.gif) no-repeat 100% 50%;
}
#nav ul li.last {
padding-bottom: 0;
}
#nav ul li.active {
margin: 0;
border: 0;
background: none;
}
#nav ul a,
#nav ul a:hover {
float: none;
padding: 0;
background: none;
line-height: normal;
}
#nav ul li a {
font-weight: normal !important;
}
/* 2nd Level */
#nav ul {
position: absolute;
width: 15em;
top: 30px;
left: -10000px;
-moz-box-shadow: 3px 6px 8px 1px rgba(0, 0, 0, 0.3);
background-color: #FFF;
margin-right: 0px;
margin-left: 0px;
padding-top: 10px;
padding-right: 0px;
padding-bottom: 10px;
padding-left: 0px;
border: medium solid #087d74;
margin-bottom: 10px;
z-index: 10;
}
/* Show menu */
#nav li.over > ul {
left: 0px;
}
#nav li.over > ul li.over > ul {
left: 100px;
}
#nav li.over ul ul {
left: -10000px;
}
#nav li:hover > ul li:hover {
background-image: none !important;
}
#nav li.parent > ul li a {
background-image: none;
text-shadow: 0px 1px #fff !important;
}
#nav li.parent > ul li a:hover {
background-image: none;
text-shadow: 0px 1px #fff !important;
}
#nav ul li a {
color: #333 !important;
border-bottom-width: 1px;
border-bottom-style: solid;
border-bottom-color: #CCC;
margin-bottom: 20px;
padding-top: 10px;
height: 20px;
margin-top: 10px;
margin-right: 12px;
margin-left: 12px;
font-size: 12px;
}
#nav ul li.last a {
border-bottom: 0px;
}
#nav ul li a:hover {
color: #087d74 !important;
text-shadow: none !important;
margin-bottom: 15px;
padding-top: 10px;
}
/* 3rd+ Level */
#nav ul ul {
top: 0px;
border: 1px solid #bdbdbd;
}
#nav ul ul li a {
border-width: 1px 0px;
}
a.bord {
border-left-width: 1px;
border-left-style: solid;
border-left-color: #FFF;
}
HTML code
<div class="nav-container">
<ul id="nav">
<li class="level0 nav-1 parent" onmouseover="toggleMenu(this,1)" onmouseout="toggleMenu(this,0)">
<a href="http://www.ivcatalina.com/magento/index.php/furniture.html">
<span>
Furniture
</span>
</a>
<ul class="level0">
<li class="level1 nav-1-1 first">
<a href="http://www.ivcatalina.com/magento/index.php/furniture/living-room.html">
<span>
Living Room
</span>
</a>
</li>
<li class="level1 nav-1-2 last">
<a href="http://www.ivcatalina.com/magento/index.php/furniture/bedroom.html">
<span>
Bedroom
</span>
</a>
</li>
</ul>
</li>
<!-- Other menu items -->
</ul>
</div>
I made you an easy solution. You doesn't even have to change your JavaScript.
In your styles.css at the #nav span class add this line to your code: margin-bottom:10px;
So it will be:
#nav span {
display:block;
cursor:pointer;
white-space:nowrap;
margin-bottom:10px;
}