Prevent horizontal shrinking of the navigation bar - html

I'm building this site but having a small problem with the navigation bar. I currently have the width=100% of the navigation which works fine but when I resize the browser horizontally it shrinks the menu's (the menus are there but the background gets cut off). I want the width to be 100% initially and not resize at all with the browser shrinking or expanding. Can anyone help?
Site: http://bepas.azurewebsites.net/
Below is my CSS. Specific line: #cssmenu {height: 50px; width:100% ...
html,body {
margin:0;
padding:0;
height:100%;
}
#cssmenu ul { margin: 0; padding: 0; white-space:nowrap;}
#cssmenu li { margin: 0; padding: 0;}
#cssmenu a { margin: 0; padding: 0;}
#cssmenu ul {list-style: none;}
#cssmenu a {text-decoration: none;}
#cssmenu {height: 50px; width:100%;background-color: #708090; box-shadow: 0px 2px 3px rgba(0,0,0,.4); }
#cssmenu > ul > li {
display:inline-block;
margin-left: 65px;
position: relative;
}
#cssmenu > ul > li > a {
color: #FFFFFF;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 18px;
line-height: 50px;
padding: 0px;
-webkit-transition: color .15s;
-moz-transition: color .15s;
-o-transition: color .15s;
transition: color .15s;
}
#cssmenu > ul > li > a:hover {color: #000000; }
body.home li.home, body.tech li.tech {font-weight:bold; }
#cssmenu > ul > li > ul {
opacity: 0;
visibility: hidden;
padding: 0px 0 20px 0;
background-color: #FFFFFF;
text-align: left;
position: absolute;
top: 55px;
left: 50%;
margin-left: -80px;
width: 260px;
-webkit-transition: all .3s .1s;
-moz-transition: all .3s .1s;
-o-transition: all .3s .1s;
transition: all .3s .1s;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
-webkit-box-shadow: 0px 1px 3px rgba(0,0,0,.4);
-moz-box-shadow: 0px 1px 3px rgba(0,0,0,.4);
box-shadow: 0px 1px 3px rgba(0,0,0,.4);
}
#cssmenu > ul > li:hover > ul {
opacity: 1;
top: 50px;
visibility: visible;
}
#cssmenu > ul ul > li { position: relative;}
#cssmenu ul ul a{
color: rgb(50,50,50);
font-family: Verdana, 'Lucida Grande';
font-size: 13px;
background-color: #FFFFFF;
padding: 5px 8px 7px 16px;
display: block;
-webkit-transition: background-color .1s;
-moz-transition: background-color .1s;
-o-transition: background-color .1s;
transition: background-color .1s;
}
#cssmenu ul ul a:hover {background-color: rgb(240,240,240);}
#cssmenu ul ul ul {
visibility: hidden;
opacity: 0;
position: absolute;
top: -16px;
left: 206px;
padding: 16px 0 20px 0;
background-color: rgb(250,250,250);
text-align: left;
width: 160px;
-webkit-transition: all .3s;
-moz-transition: all .3s;
-o-transition: all .3s;
transition: all .3s;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
-webkit-box-shadow: 0px 1px 3px rgba(0,0,0,.4);
-moz-box-shadow: 0px 1px 3px rgba(0,0,0,.4);
box-shadow: 0px 1px 3px rgba(0,0,0,.4);
}
#cssmenu ul ul > li:hover > ul { opacity: 1; left: 196px; visibility: visible;}
#cssmenu ul ul a:hover{
background-color: rgb(205,44,36);
color: rgb(240,240,240);
}
Here is my html snippet of how the menu is defined.
<div id="cssmenu">
<ul>
<li>Sites
<ul>
<li>My Sites List</li>
<li>Site General Info.</li>
<li>Utility Billing (Electricity)</li>
<li>Utility Billing (Gas)</li>
<li>Utility Billing (Solar)</li>
<li>Occupancy Info.</li>
<li>Exterior Lighting</li>
</ul>
</li>
<li>Buildings
<ul>
<li>General Info.</li>
<li>Exterior Lighting</li>
<li>Roof &amp Exhaust Fans</li>
<li>HVAC Inventory</li>
</ul>
</li>
<li>Rooms
<ul>
<li>General Info.</li>
<li>Interior Lighting</li>
<li>Windows–Envelope Fenestration</li>
<li>Doors – Envelope Fenestration</li>
<li>Plugloads</li>
<li>Skylights – Envelope Fenestration</li>
<li>Domestic Hot Water Form</li>
<li>Specialty Kitchen Equipment</li>
<li>Misc. Inventory</li>
</ul>
</li>
<li>Runtime Schedulers
<ul>
<li>link</li>
<li>link</li>
<li>link</li>
<li>link</li>
</ul>
</li>
<li>Swimming Pools
<ul>
<li>link</li>
<li>link</li>
<li>link</li>
<li>link</li>
</ul>
</li>
<li>Report</li>
<li>Temperature
<ul>
<li>link</li>
<li>link</li>
<li>link</li>
<li>link</li>
</ul>
</li>
<li>Sign in</li>
</ul>
</div>

Put this in the header tag of your html document (all of your html documents) to remove that weird behavior (this solved my problem):
<meta name="viewport" content="width=device-width, initial-scale=1.0">

make your menu items without display inline-block, replace it with float like this
#cssmenu > ul > li {
/* display: inline-block; */
margin-left: 65px;
position: relative;
float: left;
}

This is happening because you are using width:100%. What you need is to specify a min-width style and give its value in pixels. For its appropriate value in pixels check you navigation bar by re-sizing the window horizontally and select something beyond which you can't tolerate the shrinking. You can use standard 1024px, eg,
#cssmenu{ min-width: 1024px; }

Related

Third level drop down css wont show & content/links are out of order?

Some of the sub menu links of the third level are being shown in the second level while some of the second level content are not shown at all. On top of that, I don't know how to get the third level to appear at all. I'm sorry, I'm very new to this.
HTML:
<ul>
<li>Home</li>
<li>Bio</li>
<li>Portfolio
<ul>
<li>Design</li>
<ul>
<li>Illustartor</li>
<li>InDesign</li>
<li>Photoshop</li>
</ul>
<li>Media</li>
<ul>
<li>Photography</li>
<li>Video</li>
</ul>
<li>Traditional</li>
<ul>
<li>Paintings</li>
<li>Drawings</li>
</ul>
</ul>
</li>
<li>FAQ</li>
<li>Contact</li>
</ul>
CSS:
ul {
text-align: left;
display: inline;
margin: 0;
padding: 15px 4px 17px 0;
list-style: none;
-webkit-box-shadow: 0 0 5px rgba(0, 0, 0, 0.15);
-moz-box-shadow: 0 0 5px rgba(0, 0, 0, 0.15);
box-shadow: 0 0 5px rgba(0, 0, 0, 0.15);
top: 400px;
index-z: 3;
}
ul li {
font: bold 12px/18px sans-serif;
display: inline-block;
margin-right: -4px;
position: relative;
padding: 15px 20px;
background: #fff;
cursor: pointer;
-webkit-transition: all 0.2s;
-moz-transition: all 0.2s;
-ms-transition: all 0.2s;
-o-transition: all 0.2s;
transition: all 0.2s;
width: 141px;
}
ul li:hover {
background: #555;
color: #fff;
-webkit-transition: delay .5s ease-in-out;
-moz-transition: delay .5s ease-in-out;
-o-transition: delay .5s ease-in-out;
}
ul li ul {
padding: 0;
position: absolute;
top: 48px;
left: 0;
width: 150px;
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none;
display: none;
opacity: 0;
visibility: hidden;
-webkit-transiton: opacity 0.2s;
-moz-transition: opacity 0.2s;
-ms-transition: opacity 0.2s;
-o-transition: opacity 0.2s;
-transition: opacity 0.2s;
}
ul li ul li {
background: #555;
display: block;
color: #fff;
text-shadow: 0 -1px 0 #000;
}
ul li ul li:hover { background: #666; }
ul li:hover ul {
display: block;
opacity: 1;
visibility: visible;
}
li ul li ul{ /* Third Level & beyond ***********/
display:none;
background:#55aa7f;
}
li ul li:hover ul{
display:block;
position:absolute;
left:100%;
border-left:solid 3px #fff;
top:0;
width:auto;
}
li ul li ul li{
display:block;
padding:3px 10px;
border-top:solid 3px #fff;
white-space:nowrap;
}
li ul li ul li:hover span{
color:#fff;
}
.levelThreeAlign{position:relative;}
You have closed each list item in the submenu before the ul for the sub-submenu.
html should look like this fiddle:
<ul>
<li>Home</li>
<li>Bio</li>
<li>Portfolio
<ul>
<li>Design
<ul>
<li>Illustartor</li>
<li>InDesign</li>
<li>Photoshop</li>
</ul>
</li>
<li>Media
<ul>
<li>Photography</li>
<li>Video</li>
</ul>
</li>
<li>Traditional
<ul>
<li>Paintings</li>
<li>Drawings</li>
</ul>
</li>
</ul>
</li>
<li>FAQ</li>
<li>Contact</li>
</ul>
I have changed some of the css in the fiddle as well utilizing direct descendent selectors. Inheritance is very important here. when you style ul li { that will cascade down to ul li ul li { as you are styling all li that are children of a ul. doesn't matter how many levels deep.

Why is my menu being displayed as vertical instead of horizontal on IE?

So basically I have a simple menu that is not displaying correctly in IE at all.
Have visited another few posts that has this same problem, although they didn't seem to work.
Here is my HTML:
<div id="topnav">
<ul>
<li>Car Sales</li>
<li>Boat Sales</li>
<li>Caravan Sales</li>
<a href="#" title="Truck Sales"><li>Truck Sales</li><a>
<li>Equipment Sales</li>
<li>Bike Sales</li>
</ul>
</div>
Here is my CSS:
#topnav
{
text-align:center;
width:100%;
background-color:#ffffff;
}
#topnav ul a li
{
display:inline-block;
font: 12px/18px sans-serif;
color:#000000;
}
#topnav ul {
width:100%;
text-align: left;
display: inline;
margin: 0;
padding: 0px;
list-style: none;
}
#topnav ul li {
font: bold 12px/18px sans-serif;
display: inline-block;
margin-right: -4px;
position: relative;
padding: 5px 20px;
background: #fff;
cursor: pointer;
-webkit-transition: all 0.2s;
-moz-transition: all 0.2s;
-ms-transition: all 0.2s;
-o-transition: all 0.2s;
transition: all 0.2s;
-webkit-box-shadow: 0 0 5px rgba(0, 0, 0, 0.15);
-moz-box-shadow: 0 0 5px rgba(0, 0, 0, 0.15);
box-shadow: 0 0 5px rgba(0, 0, 0, 0.15);
}
#topnav ul li:hover {
background: #555;
color: #fff;
}
#topnav ul li a:hover{ color:#ffffff; }
#topnav ul li ul {
padding: 0;
position: absolute;
top: 48px;
left: 0;
width: 150px;
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none;
display: none;
opacity: 0;
visibility: hidden;
-webkit-transiton: opacity 0.2s;
-moz-transition: opacity 0.2s;
-ms-transition: opacity 0.2s;
-o-transition: opacity 0.2s;
-transition: opacity 0.2s;
}
#topnav ul li ul li {
background: #555;
display: block;
color: #fff;
text-shadow: 0 -1px 0 #000;
}
#topnav ul li ul li:hover { background: #666; }
#topnav ul li:hover ul {
display: block;
opacity: 1;
visibility: visible;
}
JSfiddle:
http://jsfiddle.net/menEk/1/
All help and suggestions would be greatly appreciated.
Your HTML code is wrong!
try it:
<ul>
<li>Car Sales</li>
<li>Boat Sales</li>
<li>Caravan Sales</li>
<li><a href="#" title="Truck Sales">Truck Sales<a></li>
<li>Equipment Sales</li>
<li>Bike Sales</li>
</ul>
and
#topnav ul li a
{
display:inline-block;
font: 12px/18px sans-serif;
color:#000000;
}
Tha a tag should be in li tag!
If you gave #topnav an exact width such as 100px and gave each li in it a width of 100% they would be forced to align vertically.
I have made a JS Fiddle to show it.
Changed css widths have:
/* CHANGED */
above them.
http://jsfiddle.net/menEk/2/

menu css menu display centre rather than left

I have this html code:
<div class="cont">
<div class="header">
header
</div><!-- header -->
<div id="cssmenu">
<ul>
<li><span>LINK</span></li>
<li><span>LINK</span></li>
<li><span>SUB LINK</span>
<ul>
<li><span>LINK</span></li>
</ul>
</li>
</ul>
</div>
</div><!-- cont -->
with this CSS for my menu:
#cssmenu *{
z-index: 999;
}
#cssmenu ul { margin: 0; padding: 0; text-align: center; }
#cssmenu li { margin: 0; padding: 0;}
#cssmenu a { margin: 0; padding: 0;}
#cssmenu ul {list-style: none;}
#cssmenu a {text-decoration: none;}
#cssmenu {
width:100%;
max-width:1000px;
height: 50px;
background-color: #666666; /* main background color */
}
#cssmenu > ul > li {
display: inline-block;
margin-left: 15px;
position: relative;
}
#cssmenu > ul > li > a {
color: #FFFFFF; /* main link text color */
font-weight:bold;
font-size: 15px;
line-height: 50px;
padding: 16px 20px;
-webkit-transition: color .15s;
-moz-transition: color .15s;
-o-transition: color .15s;
transition: color .15s;
}
#cssmenu > ul > li > a:hover {
color: #ffffff; /* main link text hover color */
background-color:#666666; /* main link background hover color */
}
#cssmenu > ul > li > ul {
opacity: 0;
visibility: hidden;
padding: 16px 0 20px 0;
background-color: #666666; /*submenu link background color */
text-align: left;
position: absolute;
top: 30px;
left: 50%;
margin-left: -90px;
width: 180px;
-webkit-transition: all .3s .1s;
-moz-transition: all .3s .1s;
-o-transition: all .3s .1s;
transition: all .3s .1s;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
-webkit-box-shadow: 0px 1px 3px rgba(0,0,0,.4);
-moz-box-shadow: 0px 1px 3px rgba(0,0,0,.4);
box-shadow: 0px 1px 3px rgba(0,0,0,.4);
}
#cssmenu > ul > li:hover > ul {
opacity: 1;
top: 50px;
visibility: visible;
}
#cssmenu > ul > li > ul:before{
content: '';
display: block;
border-color: transparent transparent rgb(250,250,250) transparent;
border-style: solid;
border-width: 10px;
position: absolute;
top: -20px;
left: 50%;
margin-left: -10px;
}
#cssmenu > ul ul > li { position: relative;}
#cssmenu ul ul a{
color: #FFFFFF; /* submenu link text color */
font-size: 13px;
background-color: #666666; /*submenu background color (behind links) */
padding: 5px 8px 7px 16px;
display: block;
-webkit-transition: background-color .1s;
-moz-transition: background-color .1s;
-o-transition: background-color .1s;
transition: background-color .1s;
}
#cssmenu > ul > li:hover {
background-color:#666666; /*background color that shows on the main menu link when hovering over the sub menu */
}
#cssmenu > ul > li:hover > a{
color: #FFFFFF; /* main menu link hover text color */
}
#cssmenu ul ul ul {
visibility: hidden;
opacity: 0;
position: absolute;
top: -16px;
left: 206px;
background-color:#666666;
padding: 16px 0 20px 0;
text-align: left;
width: 160px;
-webkit-transition: all .3s;
-moz-transition: all .3s;
-o-transition: all .3s;
transition: all .3s;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
-webkit-box-shadow: 0px 1px 3px rgba(0,0,0,.4);
-moz-box-shadow: 0px 1px 3px rgba(0,0,0,.4);
box-shadow: 0px 1px 3px rgba(0,0,0,.4);
}
#cssmenu ul ul > li:hover > ul {
opacity: 1; left: 196px;
visibility: visible;
}
#cssmenu ul ul a:hover{
background-color: #666666; /*submenu link hover color */
/* color:#000000; */
}
#cssmenu > ul > li.active {
background-color:#666666;
}
as the page width gets bigger, the menu displays more to the left. how can i make is always display center under the header?
here is a fiddle with my full code: http://jsfiddle.net/Nqxe9/
To your CSS add the styles:
#cssmenu {
margin:0px auto;
padding: 9px 9px 0;
}
Fiddle :http://jsfiddle.net/Nqxe9/5/
Perfect!!
Done ;)
Add below css for li.
#cssmenu > ul > li {
display: inline-block;
float: left;
margin-left: 15px;
position: relative;
}
you need to add float:left
Live Demo
I added a margin: 0 auto;
JSFiddle
I'd like to see the CSS for your header; however, if you're trying to make it stay under the header I'd make a div to surround the header and the menu and put properties to that div to center it.
<div class="Container"><!-- Maybe make this class header depending on your css -->
<div class="header">
header
</div><!-- header -->
<div id="cssmenu">
<ul>
<li><span>LINK</span></li>
<li><span>LINK</span></li>
<li><span>SUB LINK</span>
<ul>
<li><span>LINK</span></li>
</ul>
</li>
</ul>
</div>
</div> <!-- Close the new div here -->

CSS menu is being overlapped by text

My css menu is being overlapped by my text at the bottom, this is causing the menu to be rendered useless as when you hover over it and initiate the drop down the text overlaps and the menu comes back up.
i would really appreciate the help with the coding. I am a absolute newbie. if there are changes to the code please could you tell me where to put them.
a link to the menu is at http://stock-trade-101.com/market-indicators/
css code
#cssmenu ul {
margin: 0;
padding: 0;
}
#cssmenu li {
margin: 0;
padding: 0;
}
#cssmenu a {
margin: 0;
padding: 0;
}
#cssmenu ul {
list-style: none;
}
#cssmenu a {
text-decoration: none;
}
#cssmenu {
height: 70px;
background-color: #232323;
box-shadow: 0px 2px 3px rgba(0, 0, 0, 0.4);
width: auto;
}
#cssmenu > ul > li {
float: left;
margin-left: 15px;
position: relative;
}
#cssmenu > ul > li > a {
color: #a0a0a0;
font-family: Verdana, 'Lucida Grande';
font-size: 15px;
line-height: 70px;
padding: 15px 20px;
-webkit-transition: color .15s;
-moz-transition: color .15s;
-o-transition: color .15s;
transition: color .15s;
}
#cssmenu > ul > li > a:hover {
color: #ffffff;
}
#cssmenu > ul > li > ul {
opacity: 0;
visibility: hidden;
padding: 16px 0 20px 0;
background-color: #fafafa;
text-align: left;
position: absolute;
top: 55px;
left: 50%;
margin-left: -90px;
width: 180px;
-webkit-transition: all .3s .1s;
-moz-transition: all .3s .1s;
-o-transition: all .3s .1s;
transition: all .3s .1s;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
-webkit-box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.4);
-moz-box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.4);
box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.4);
}
#cssmenu > ul > li:hover > ul {
opacity: 1;
top: 65px;
visibility: visible;
}
#cssmenu > ul > li > ul:before {
content: '';
display: block;
border-color: transparent transparent #fafafa transparent;
border-style: solid;
border-width: 10px;
position: absolute;
top: -20px;
left: 50%;
margin-left: -10px;
}
#cssmenu > ul ul > li {
position: relative;
}
#cssmenu ul ul a {
color: #323232;
font-family: Verdana, 'Lucida Grande';
font-size: 13px;
background-color: #fafafa;
padding: 5px 8px 7px 16px;
display: block;
-webkit-transition: background-color 0.1s;
-moz-transition: background-color 0.1s;
-o-transition: background-color 0.1s;
transition: background-color 0.1s;
}
#cssmenu ul ul a:hover {
background-color: #f0f0f0;
}
#cssmenu ul ul ul {
visibility: hidden;
opacity: 0;
position: absolute;
top: -16px;
left: 206px;
padding: 16px 0 20px 0;
background-color: #fafafa;
text-align: left;
width: 180px;
-webkit-transition: all .3s;
-moz-transition: all .3s;
-o-transition: all .3s;
transition: all .3s;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
-webkit-box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.4);
-moz-box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.4);
box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.4);
}
#cssmenu ul ul > li:hover > ul {
opacity: 1;
left: 190px;
visibility: visible;
}
#cssmenu ul ul a:hover {
background-color: #cc2c24;
color: #f0f0f0;
}
HTML code for CSS menu
<div id='cssmenu'>
<ul>
<li class='has-sub'><a href='#'><span>Trending</span></a>
<ul>
<li class='has-sub'><a href='#'><span>Support and Resisrance</span></a>
<ul>
<li><a href='#'><span>Creation of Support</span></a></li>
<li><a href='#'><span>Creation of Resistance</span></a></li>
<li><a href='#'><span>Broken Support Becoming Resistance</span></a></li>
<li><a href='#'><span>Broken Resistance Becoming Support</span></a></li>
<li class='last'><a href='#'><span>Significance of Support and Resistance</span></a></li>
</ul>
</li>
<li><a href='#'><span>Dow Theory</span></a></li>
<li><a href='#'><span>Channel Lines</span></a></li>
<li><a href='#'><span>Trendlines</span></a></li>
<li class='last'><a href='#'><span>Fan Principle</span></a></li>
</ul>
</li>
<li class='has-sub'><a href='#'><span>Chart Patterns</span></a>
<ul>
<li class='has-sub'><a href='#'><span>Head And Shoulders Pattern</span></a>
<ul>
<li><a href='#'><span>Formation In Bull Market</span></a></li>
<li class='last'><a href='#'><span>Formation in Bear Market</span></a></li>
</ul>
</li>
<li><a href='#'><span>Key Reversal</span></a></li>
<li class='has-sub'><a href='#'><span>Symmetrical Triangles</span></a>
<ul>
<li><a href='#'><span>Ascending Triangle</span></a></li>
<li class='last'><a href='#'><span>Descending Triangle</span></a></li>
</ul>
</li>
<li><a href='#'><span>Rectangles</span></a></li>
<li><a href='#'><span>Flags</span></a></li>
<li class='last'><a href='#'><span>Pennants</span></a></li>
</ul>
</li>
<li class='has-sub last'><a href='#'><span>Oscillators and indicators</span></a>
<ul>
<li><a href='#'><span>Leading and Lagging</span></a></li>
<li><a href='#'><span>RSI</span></a></li>
<li><a href='#'><span>Stochastic Oscillator </span></a></li>
<li class='last'><a href='#'><span>MACD</span></a></li>
</ul>
</li>
</ul>
</div>
Finally got it, the text had a z-index set on it, causing it to render above the menu.
Remove the following, and your problem is solved:
.sqs-block {
position: relative;
clear: both;
z-index: 1;
}

CSS Drop Down Menu - Gaps between Drop down and Sub Menu, disappears in IE

I am currently using a CSS menu on PHP includes. I have gotten to to be compatible with IE and Chrome and I assume Firefox. However in IE, The sub menu for my drop down menu is to far away from the drop down and disapears before I can hover above it.
The original CSS
#cssmenu ul { margin: 0; padding: 0;}
#cssmenu li { margin: 0; padding: 0;}
#cssmenu a { margin: 0; padding: 0;}
#cssmenu ul {list-style: none;}
#cssmenu a {text-decoration: none;}
#cssmenu {height: 70px; background-color: rgb(35,35,35); box-shadow: 0px 2px 3px rgba(0,0,0,.4);}
#cssmenu > ul > li {
float: left;
margin-left: 15px;
position: relative;
}
#cssmenu > ul > li > a {
color: rgb(160,160,160);
font-family: Verdana, 'Lucida Grande';
font-size: 15px;
line-height: 70px;
padding: 15px 20px;
-webkit-transition: color .15s;
-moz-transition: color .15s;
-o-transition: color .15s;
transition: color .15s;
}
#cssmenu > ul > li > a:hover {color: rgb(250,250,250); }
#cssmenu > ul > li > ul {
opacity: 0;
visibility: hidden;
padding: 16px 0 20px 0;
background-color: rgb(250,250,250);
text-align: left;
position: absolute;
top: 55px;
left: 50%;
margin-left: -90px;
width: 180px;
-webkit-transition: all .3s .1s;
-moz-transition: all .3s .1s;
-o-transition: all .3s .1s;
transition: all .3s .1s;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
-webkit-box-shadow: 0px 1px 3px rgba(0,0,0,.4);
-moz-box-shadow: 0px 1px 3px rgba(0,0,0,.4);
box-shadow: 0px 1px 3px rgba(0,0,0,.4);
}
#cssmenu > ul > li:hover > ul {
opacity: 1;
top: 65px;
visibility: visible;
}
#cssmenu > ul > li > ul:before{
content: '';
display: block;
border-color: transparent transparent rgb(250,250,250) transparent;
border-style: solid;
border-width: 10px;
position: absolute;
top: -20px;
left: 50%;
margin-left: -10px;
}
#cssmenu > ul ul > li { position: relative;}
#cssmenu ul ul a{
color: rgb(50,50,50);
font-family: Verdana, 'Lucida Grande';
font-size: 13px;
background-color: rgb(250,250,250);
padding: 5px 8px 7px 16px;
display: block;
-webkit-transition: background-color .1s;
-moz-transition: background-color .1s;
-o-transition: background-color .1s;
transition: background-color .1s;
}
#cssmenu ul ul a:hover {background-color: rgb(240,240,240);}
#cssmenu ul ul ul {
visibility: hidden;
opacity: 0;
position: absolute;
top: -16px;
left: 206px;
padding: 16px 0 20px 0;
background-color: rgb(250,250,250);
text-align: left;
width: 160px;
-webkit-transition: all .3s;
-moz-transition: all .3s;
-o-transition: all .3s;
transition: all .3s;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
-webkit-box-shadow: 0px 1px 3px rgba(0,0,0,.4);
-moz-box-shadow: 0px 1px 3px rgba(0,0,0,.4);
box-shadow: 0px 1px 3px rgba(0,0,0,.4);
}
#cssmenu ul ul > li:hover > ul { opacity: 1; left: 196px; visibility: visible;}
#cssmenu ul ul a:hover{
background-color: rgb(205,44,36);
color: rgb(240,240,240);
}
MENU code:
<div id='cssmenu'>
<ul>
<li><a href='index.php'><span>Home</span></a></li>
<li><a href='about.php'><span>About</span></a></li>
<li class='has-sub '><a href='#'><span>Services</span></a>
<ul>
<li class='has-sub '><a href='4wdtraining.php'><span>4WD Training</span></a>
<ul>
<li><a href='basictraining.php'><span>Basic</span></a></li>
<li><a href='intermediatetraining.php'><span>Intermediate</span></a></li>
<li><a href='advancedtraining.php'><span>Advanced</span></a></li>
<li><a href='nightdriving.php'><span>Night Driving</span></a></li>
<li><a href='recovery.php'><span>Recovery</span></a></li>
<li><a href='custompackages.php'><span>Custom Packages</span></a></li>
</ul>
</li>
<li><a href='bushmechanic.php'><span>Bush Mechanic</span></a></li>
</ul>
</li>
<li><a href='estore.php'><span>eStore</span></a></li>
<li><a href='gallery.php'><span>Gallery</span></a></li>
<li><a href='#'><span>Contact</span></a></li>
</ul>
</div>
Live example at www.offthebitumen.com.au
Things I have tried: Changing the padding, changing positions from absolute to relative, getting rid of the border, adding display: inline - nothing has worked.
Also if anyone has Chrome and IE, why is the menu more rounded compared to the IE version? Is there anything I can do about it?
It's because you have a gap.
I did a little hack, hope it will help.
<div id='cssmenu'>
<ul>
<li><a href='index.php'><span>Home</span></a></li>
<li><a href='about.php'><span>About</span></a></li>
<li class='has-sub '><a href='#'><span>Services</span></a>
<ul>
<li class='has-sub '><a href='4wdtraining.php'><span>4WD Training</span></a>
<ul>
<li><a href='basictraining.php'><span>Basic</span></a></li>
<li><a href='intermediatetraining.php'><span>Intermediate</span></a></li>
<li><a href='advancedtraining.php'><span>Advanced</span></a></li>
<li><a href='nightdriving.php'><span>Night Driving</span></a></li>
<li><a href='recovery.php'><span>Recovery</span></a></li>
<li><a href='custompackages.php'><span>Custom Packages</span></a></li>
</ul>
<!-- THIS IS THE FIX --> <div class="hack"></div> <!-- end FIX -->
</li>
<li><a href='bushmechanic.php'><span>Bush Mechanic</span></a></li>
</ul>
</li>
<li><a href='estore.php'><span>eStore</span></a></li>
<li><a href='gallery.php'><span>Gallery</span></a></li>
<li><a href='#'><span>Contact</span></a></li>
</ul>
</div>
And just 2 bits of css:
#cssmenu ul ul > li:hover > ul { opacity: 1; left: 196px; visibility: visible;}
#cssmenu ul ul ul {
z-index: 5;
}
Good luck !