Make submenu vertical layout in an existing nav menu - html

I have a menu nav function in css3 and html
<nav>
<ul>
<li><a href="#" >Sec1</a></li>
<li><a href="#" >Sec2</a></li>
<li>Sec3
<ul class="menu">
<li>Documents</li>
<li>Messages</li>
<li>Sign Out</li>
</ul></li>
<li><a href="#" >Sec4</a></li>
</ul>
</nav>
but How can the submenu be like:
instead of:
--Fiddle-
here is fiddle

I understand what you are looking for and have made my jsfiddle as close as possible to yours. Instead of using the images you provided, I used icon fonts, which are useful if you plan on using many images. I got my icon font from Keyamoon at icomoon.io. It's a really good tool to have and you should definitely use it for any other icons you need. I picked mine from Icon Minia by Egemen Kapusuz. You can see the icons I used and if those are the only ones you need just download the files from the #font-face urls in the jsfiddle, or from here:
#font-face {
font-family: 'IHK';
src:url('http://ilanshomekitchen.x10.mx/icon font testing/IHK.eot');
src:url('http://ilanshomekitchen.x10.mx/icon font testing/IHK.eot?#iefix') format('embedded-opentype'),
url('http://ilanshomekitchen.x10.mx/icon font testing/IHK.svg#IHK') format('svg'),
url('http://ilanshomekitchen.x10.mx/icon font testing/IHK.woff') format('woff'),
url('http://ilanshomekitchen.x10.mx/icon font testing/IHK.ttf') format('truetype');
font-weight: normal;
font-style: normal;
}
You can just copy the links from here and it will give you the font file to download if you only need these 3 icons. Icon fonts are great because instead of loading 1 image for each background or icon or whatever, you can package the icon fonts all together into 1 HTTP request, making them more efficient in the transfer, and also more customizable. Icon fonts are just a font, so you can also manipulate them much more easily; you can change the color of the font, the anti-aliasing, just like a real text font.
I rewrote your code with some jQuery because yours seemed very jumbled and a little hard to understand, so if you would like to use my exact jsfiddle, you will need to add a jquery source link either from a CDN or host your own copy on your server. jquery.com will have tons of info about that.
So for my HTML:
HTML:
<nav>
<ul>
<li><a href="#" >Sec1</a></li>
<li><a href="#" >Sec2</a></li>
<li>Sec3</li>
<li><a href="contacto.html" >Sec4</a></li>
<ul class="menu">
<li>Documents</li>
<br>
<li>Messages</li>
<br>
<li>Sign Out</li>
</ul>
</ul>
</nav>
The html has some new attributes, which I titled data-icon. I used these to incorporate the icons from the icon font without adding an official element in the DOM. Browser support for this is a little new, so you should look into a redundant icon scheme just in case users are using an old browser that doesn't support icon fonts and the other new features that you also had like border-radius and transitions.
The CSS was modified a lot to use psuedo selectors, which are very useful. Additionally, I now have the nav bar working from jQuery, so it should be supported well because jQuery is a cross-browser JavaScript libary.
The only thing I couldn't fix was this little problem where the hovered text in the 2nd navigation level would jump, I don't know why that happens, I will look into it, but for now, this is what I was able to produce for you.

I Change a little your CSS And Html File
Css:
nav
{
position: absolute;
list-style: none;
text-align: center;
width: 620px;
top: 43px;
right: -12px;
background: transparent;
}
nav ul li
{
float: left;
line-height: normal;
}
nav ul li a
{
font-size: 28px;
font-family: 'Yanone Kaffeesatz', arial, sans-serif;
color: black;
text-transform: capitalize;
font-weight: normal;
display: block; /* IE6, IE7 line height fix */
padding: 15px;
background-color: transparent;
margin-top: 0px;
margin-right: 6px;
text-decoration: none;
-webkit-transition: all .3s ease-in-out;
-moz-transition: all .3s ease-in-out;
}
nav ul li:hover > ul
{
display: inline;
}
nav ul li a:hover
{
background-color: #43AEF2;
padding: 15px;
color: white;
-moz-border-radius: 8px;
border-radius: 8px;
}
nav ul li a.current
{
background-color: #43aef2;
color: white;
-moz-border-radius: 8px;
border-radius: 8px;
}
nav ul:not(.first) li
{
text-align: center;
display: inline-block;
cursor: pointer;
margin-right: 10px;
color: #666;
transition: 0.3s;
-webkit-transition: 0.3s;
-moz-transition: 0.3s;
-o-transition: 0.3s;
-ms-transition: 0.3s;
}
nav ul:not(.first) li:last-child
{
margin-right: 0;
}
nav ul:not(.first) li:hover
{
color: #000;
}
nav ul:not(.first) li:hover:after
{
color: #bbb;
}
nav ul:not(.first) li:after
{
margin-left: 10px;
content: '';
color: #bbb;
}
nav ul:not(.first) li:last-child:after
{
content: '';
}
.content_menu
{
float: left;
width: 274px;
margin-top: -10px;
margin-bottom: 15px;
}
.content_menu ul
{
margin: 0px;
padding: 0px;
float: none;
}
.content_menu ul li
{
float: none;
padding-bottom: 16px;
}
.content_menu ul li a
{
font-size: 14px;
line-height: normal;
color: #33CC99;
text-align: left;
text-decoration: none;
padding-left: 20px;
}
.content_menu ul li a:hover
{
color: #33CC99;
}
/* submenu */
.menu
{
display: none;
position: absolute;
background: black;
width: 140px;
}
.menu li a
{
display: block;
padding: 0 14px 0 30px;
margin: 6px 0;
line-height: 28px;
text-decoration: none;
border-left: 1px solid #393942;
border-right: 1px solid #4f5058;
font-family: Helvetica, Arial, sans-serif;
font-weight: bold;
font-size: 13px;
color: #f3f3f3;
text-shadow: 1px 1px 1px rgba(0,0,0,.6);
-webkit-transition: color .2s ease-in-out;
-moz-transition: color .2s ease-in-out;
-o-transition: color .2s ease-in-out;
-ms-transition: color .2s ease-in-out;
transition: color .2s ease-in-out;
}
.menu li:first-child a
{
border-left: none;
}
.menu li:last-child a
{
border-right: none;
}
.menu li:hover > a
{
color: #33CC99;
}
.menu ul
{
position: absolute;
top: 60px;
left: 0;
opacity: 0;
background: #1f2024;
-webkit-border-radius: 0 0 5px 5px;
-moz-border-radius: 0 0 5px 5px;
border-radius: 0 0 5px 5px;
-webkit-transition: opacity .25s ease .1s;
-moz-transition: opacity .25s ease .1s;
-o-transition: opacity .25s ease .1s;
-ms-transition: opacity .25s ease .1s;
transition: opacity .25s ease .1s;
}
.menu li:hover > ul
{
opacity: 1;
}
.menu ul li
{
height: 0;
overflow: hidden;
padding: 0;
-webkit-transition: height .25s ease .1s;
-moz-transition: height .25s ease .1s;
-o-transition: height .25s ease .1s;
-ms-transition: height .25s ease .1s;
transition: height .25s ease .1s;
}
.menu li:hover > a
{
height: auto;
}
.menu li a
{
width: 100px;
padding: 4px 0 4px 40px;
margin: 0;
border: none;
border-bottom: 1px solid #353539;
}
.menu ul li:last-child a
{
border: none;
}
/* Icons */
.menu a.documents
{
background: url(http://designmodo.com/demo/css3dropdownmenu/img/docs.png) no-repeat 6px center;
}
.menu a.messages
{
background: url(http://designmodo.com/demo/css3dropdownmenu/img/bubble.png) no-repeat 6px center;
}
.menu a.signout
{
background: url(http://designmodo.com/demo/css3dropdownmenu/img/arrow.png) no-repeat 6px center;
}
.menu li
{
float: none;
display: initial;
}
HTML
<nav>
<ul>
<li><a href="#" >Sec1</a></li>
<li><a href="#" >Sec2</a></li>
<li>Sec3
<ul class="menu">
<li>Documents</li>
<li>Messages</li>
<li>Sign Out</li>
</ul></li>
<li><a href="contacto.html" >Sec4</a></li>
</ul>
</nav>

Related

How to Create a Smooth Dropping Animation in CSS?

I am trying to create a smooth animation of my nav-bar in CSS here's my HTML Code-
<body>
<nav class="navbar">
<ul class="nav-list another">
<li><n>Engine</n></li>
<li>Home</li>
<li>About</li>
<li>Contact Us</li>
<li><button type="button" id="mysearch">More</button></li>
</ul>
</nav>
<hr>
</body>
</html>
Here's my CSS Code-
*{
margin: 0;
padding: 0;
}
html{
background-color: white;
background-image: url("img/ManHattanImage.webp");
}
li{
align-items: left;
width: 100px;
height: 100%;
display: inline-block;
margin-right: 170px;
font-size: 20px;
/* background-color: black; */
color: black;
font-size: 20px;
}
hr{
color: black;
margin-top: 30px;
}
n{
/* background-color: black; */
color: white;
font-size: 40px;
font-style: bold;
font-family: "Lucida Console", "Courier New", monospace;
margin-left: 20px;
margin-top: 30px;
}
a {
text-decoration: none;
color: white;
}
a:visited { text-decoration: none; }
a:hover {
text-decoration: none;
/* background-color: black; */
}
a:focus { text-decoration: none; }
a:hover, a:active { text-decoration: none; }
nav:hover{
height:300px;
}
I want a clean Animation like of a good dropdown menu navbar and with clear overlaps, Also I may add some more elements inside the navbar (With Further Updates)?
This is how to make a dropdown menu but I'm not sure how to do an animation. I hope this is what you meant by the dropdown menu.
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
.dropbtn {
background-color: #ac0d0d;
color: white;
padding: 16px;
font-size: 16px;
border: none;
}
.dropdown {
position: relative;
display: inline-block;
}
.dropdown-content {
display: none;
position: absolute;
background-color: #ffffff;
min-width: 160px;
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
z-index: 1;
}
.dropdown-content a {
color: rgb(18, 19, 85);
padding: 12px 16px;
text-decoration: none;
display: block;
}
.dropdown-content a:hover {background-color: #ddd;}
.dropdown:hover .dropdown-content {display: block;}
.dropdown:hover .dropbtn {background-color: #ac0d0d;}
</style>
</head>
<body>
<div class="dropdown">
<button class="dropbtn">Dropdown menu</button>
<div class="dropdown-content">
first
second
third
</div>
</div>
</body>
</html>
Animation Drop down menu on hover
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
nav {
width: 100%;
height: 80px;
background: #222;
}
ul {
text-align: center;
}
ul li {
font: 13px Verdana, 'Lucida Grande';
cursor: pointer;
-webkit-transition: padding .05s linear;
-moz-transition: padding .05s linear;
-ms-transition: padding .05s linear;
-o-transition: padding .05s linear;
transition: padding .05s linear;
}
ul li.drop {
position: relative;
}
ul > li {
display: inline-block;
}
ul li a {
line-height: 80px;
padding: 0 20px;
height: 80px;
color: #777;
-webkit-transition: all .1s ease-out;
-moz-transition: all .1s ease-out;
-ms-transition: all .1s ease-out;
-o-transition: all .1s ease-out;
transition: all .1s ease-out;
}
ul li a:hover {
color: #eee;
}
.dropOut .triangle {
width: 0;
height: 0;
position: absolute;
border-left: 8px solid transparent;
border-right: 8px solid transparent;
border-bottom: 8px solid white;
top: -8px;
left: 50%;
margin-left: -8px;
}
.dropdownContain {
width: 160px;
position: absolute;
z-index: 2;
left: 50%;
margin-left: -80px; /* half of width */
top: -400px;
}
.dropOut {
width: 160px;
background: white;
float: left;
position: relative;
margin-top: 0px;
opacity: 0;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
-webkit-box-shadow: 0 1px 6px rgba(0,0,0,.15);
-moz-box-shadow: 0 1px 6px rgba(0,0,0,.15);
box-shadow: 0 1px 6px rgba(0,0,0,.15);
-webkit-transition: all .1s ease-out;
-moz-transition: all .1s ease-out;
-ms-transition: all .1s ease-out;
-o-transition: all .1s ease-out;
transition: all .1s ease-out;
}
.dropOut ul {
float: left;
padding: 10px 0;
}
.dropOut ul li {
text-align: left;
float: left;
width: 125px;
padding: 12px 0 10px 15px;
margin: 0px 10px;
color: #777;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
-webkit-transition: background .1s ease-out;
-moz-transition: background .1s ease-out;
-ms-transition: background .1s ease-out;
-o-transition: background .1s ease-out;
transition: background .1s ease-out;
}
.dropOut ul li:hover {
background: #f6f6f6;
}
ul li:hover a { color: white; }
ul li:hover .dropdownContain { top: 65px; }
ul li:hover .underline { border-bottom-color: #777; }
ul li:hover .dropOut { opacity: 1; margin-top: 8px; }
</style>
<body>
<nav>
<ul>
<li class="drop">
You
<div class="dropdownContain">
<div class="dropOut">
<div class="triangle"></div>
<ul>
<li>Plan</li>
<li>Account Settings</li>
<li>Switch Account</li>
<li>Sign Out</li>
</ul>
</div>
</div>
</li>
</ul>
</nav>
</body>
</html>

How to create a menu with images and labels (HTML and CSS)?

I'm having a little problem, I was trying to make a menu combining items with image and other items with labels, as in the attached image, but it doesn''t work.
Next image shows how it is currently. With error.
I've tried with this code, but my "picture item" don't stand next to the "label item":
.sprite-icons {
background: url(../images/icons/sprite-icons_menu.png) no-repeat top left;
-webkit-transition: all 0.3s ease;
-o-transition: all 0.3s ease;
-moz-transition: all 0.3s ease;
width: 33px; height: 30px;
}
.sprite-icons.icon_home {
background-position: 0px 0px;
}
.icon_home:hover{
background-position: -48px 0px;
}
.sprite-icons.icon_home_active {
background-position: -48px 0px;
}
.sf-menu{
border-bottom: 1px solid black;
list-style-type:none;
line-height: 1.0;
text-align: center;
padding: 10px 10px 8px 10px;
float: left;
width: 99%;
}
.sf-menu a{
text-decoration: none;
color: #606060;
-webkit-transition: all 0.3s ease; -o-transition: all 0.3s ease; -moz-transition: all 0.3s ease;
}
.sf-menu a:hover{
color: #ffffff;
background-color: #ee1c24;
padding: 10px 6px 6px 6px;
}
.sf-menu li{
display: inline;
padding: 20px;
}
<nav>
<ul class="sf-menu">
<li><a href="" title="Home">
<div class="sprite-icons icon_home">
</div></a>
</li>
<li>A EMPRESA</li>
<li>SERVIÇOS</li>
<li>SISTEMA</li>
<li>TRABALHE CONOSCO</li>
<li>CONTATO</li>
</ul>
</nav>
How can I solve this?
Better solution should be use pseudo-element
:before
Example:
ul li
{
display: inline-block;
}
.icon-tutti:before {
content: "\e908";
}
span [class^=icon-] {
font-size: 1.3em;
margin-right: 10px;
color: #ff653e;
}
<ul>
<li><span class="icon-tutti"></span></li>
<li>Second Element</li>
<li>Third Element</li>
</ul>
You can also use an image url as content, but using icons should be better. Try fontAwesome for example.

Font displays different in Chrome and in Firefox

I am a bit new when it comes to web development.
I have created a menu but its buttons width are different depending on the browser (Firefox or Chrome)
In Firefox, we can see that the end of the last button of the menu is aligned with the div below. We can also appreciate that the width of the button is 136.5px
However, in Chrome the fonts are bolder and the menu end is pushed a bit forward. Here, the width of the button is 139.281px
This is the site, the menu is on the top: http://www.metagame.gg/champions/
This is the HTML and the CSS code for the menu
.navigator {
margin: 0;
padding: 0;
display: flex;
padding-left: 39px;
background: #8C9BAA;
}
.navigator li {
display: inline-block;
position: relative;
z-index:100;
}
.navigator li a {
text-decoration: none;
font-size: 15px;
display: block;
line-height: 50px;
padding: 2px 27.75px 0px;
-webkit-transition: all 0.2s ease-in-out 0s;
-moz-transition: all 0.2s ease-in-out 0s;
-o-transition: all 0.2s ease-in-out 0s;
-ms-transition: all 0.2s ease-in-out 0s;
transition: all 0.2s ease-in-out 0s;
}
.navigator li a:hover, .navigator li:hover > a {
color:#fff;
background: #7AAFD1;
}
.navigator ul {
display: none;
margin: 0;
padding: 0;
width: 170px;
position: absolute;
left: 0px;
}
.navigator ul li {
display:block;
float: none;
background:none;
margin:0;
padding:0;
}
.navigator ul li a {
font-size:12px;
font-weight:bold;
display:block;
color:#797979;
border-left: 3px solid #ffffff;
background: #fff;
line-height: 42px;
transition: 0s;
}
.navigator ul li a:hover, .menu ul li:hover > a {
background:#EFEFEF;
border-left:3px solid #83BEE4;
color: #12303D;
}
.navigator li:hover > ul {
display: block;
}
.navigator ul ul {
left: 149px;
top: 0px;
}
#in {
color:#fff;
background: #7AAFD1;
}
.sub-menu {
border:1px solid #ddd;
border-top:0px;
border-left:0px;
box-shadow: 3px 5px 5px -5px #3B3B3B;
}
.navigatorSecond {
margin: 0;
padding: 0;
display: flex;
padding-left: 39px;
background: #d1d1d1 ;
}
.navigatorSecond li {
display: inline-block;
position: relative;
z-index:80;
}
.navigatorSecond li a {
font-weight:600;
text-decoration:none;
font-size: 13px;
display:block;
color:#4a4a4a;
line-height: 40px;
padding: 0px 35.3px;
-webkit-transition: all 0.2s ease-in-out 0s;
-moz-transition: all 0.2s ease-in-out 0s;
-o-transition: all 0.2s ease-in-out 0s;
-ms-transition: all 0.2s ease-in-out 0s;
transition: all 0.2s ease-in-out 0s;
}
#ini {
color:#fff;
background: #7AAFD1;
}
.navigatorSecond li a:hover, .navigatorSecond li:hover > a {
color:#fff;
background: #7AAFD1;
}
.navigatorSecond ul {
display: none;
margin: 0;
padding: 0;
width: 170px;
position: absolute;
left: 0px;
}
.navigatorSecond ul li {
display:block;
float: none;
background:none;
margin:0;
padding:0;
}
.navigatorSecond ul li a {
font-size:13px;
font-weight:bold;
display:block;
color:#797979;
border-left: 3px solid #ffffff;
background: #fff;
line-height: 42px;
transition: 0s;
}
<div class="menuWrap">
<ul class="navigator">
<li>HOME</li>
<li>CHAMPIONS</li>
<li>SOLO QUEUE <img class="iconMenu" src="/icon/expandir.png" alt=""/>
<ul class="sub-menu">
<li>Tier List</li>
<li>Basics & Tactics</li>
<li>Psychology</li>
<li>Picks & Bans</li>
<li>Division analysis</li>
</ul>
</li>
<li>PRO SCENE <img class="iconMenu" src="/icon/expandir.png" alt=""/>
<ul class="sub-menu">
<li>Sub-Menu 1</li>
<li>Sub-Menu 2</li>
<li>Sub-Menu 3</li>
</ul>
</li>
<li>IN-DEPTH ANALYSIS</li>
<li>STATISTICS</li>
</ul>
</div>
I think it is because the font is a bit bolder in Chrome and that causes the button width to be higher.
Thanks in advance
Update: This is because each browser has its own font rendering engine.
I replicated your results with your current sans-serif font. The case also occurred when I changed the font to monospace.
I believe you're better off using a non-system font. For instance, I wanted to see what would happen with a typical Google font such as Open Sans, and I found that the issue did not exist when using it.
By the way, good work on that website. It looks nice. TSM! TSM! TSM!
*{margin:0; padding:0;}
put this line in top of your css file. It helps me for different browser. Just let me know that it helps you or not.
.navigatorSecond li {
display: inline-block;
position: relative;
z-index:80;
}
instead of display inline-block use float left. that will not be different. or use .navigatorsecond{font-size=0;}

Hovering over menu item removes left border. How do I leave menu border on hover?

I've got a menu made that utilizes left and right borders to separate each menu item. When hovering over the menu, the background changes to a lighter shade, which is what I want. However, hovering also covers the left border. How can I stop the border from disappearing? I'm sure this has been answered elsewhere, but I couldn't find it. Thanks, in advance.
http://jsfiddle.net/aYsKp/2/
HTML:
<div id="header">
<div id="menu">
<ul>
<li>HOME
</li>
<li>PRODUCTS
</li>
<li>VIDEOS
</li>
<li>DOWNLOADS
</li>
<li>CONTACT
</li>
<li>ABOUT
</li>
</ul>
</div>
</div>
CSS:
#header {
width:960px;
margin: 10px auto 5px auto;
background-color: #727272;
}
#menu {
max-width:828px;
bottom:0;
right:0;
font: 12px/18px sans-serif;
}
#menu a {
text-decoration: none;
display:block;
padding: 10px 32px;
color:#FFF;
}
#menu ul {
text-align: left;
display: inline;
margin: 0;
padding: 15px 4px 17px 0;
list-style: none;
}
#menu ul li {
display: inline-block;
margin-right: -4px;
position: relative;
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;
border-right: 1px solid #FFF;
}
#menu ul li:first-child {
border-left: 1px solid #FFF;
}
#menu ul li:hover {
background-color:#818181;
}
Try this approach.
#header {
width:960px;
margin: 10px auto 5px auto;
}
#menu {
max-width:828px;
bottom:0;
right:0;
font: 12px/18px sans-serif;
background-color: white;
}
#menu a {
text-decoration: none;
display:block;
padding: 10px 32px;
color:#FFF;
}
#menu ul {
text-align: left;
display: inline;
margin: 0;
padding: 15px 4px 17px 0;
list-style: none;
}
#menu ul li {
display: inline-block;
position: relative;
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;
background-color: #727272;
margin:0;
}
#menu ul li:hover {
background-color:#818181;
}
What I've done is just removed right margin and specified background color as white for the menu div.
I use to set border or space informations in A tag, not in LI, making LI like an "invisible" tag, setting all properties to A, using A display:inline-block.

Having trouble getting horizontal 3 level css menu to show 3rd level proplerly. I have included html and css

I'm having trouble creating the third level fligh out for a horizontal css menu. I've tried many different changes to the css to no avail. I have included the menu html and the css. What changes do I need to make to the css to have it work?
When 'ADD SCORES' is hovered over the 2 menus should show to the right
#menu {
background-color: #66A366;
padding: 6px 0 6px 20px;
}
#menu ul li a {
color: #fff;
text-decoration: none;
font-family:"Arial Narrow", "Myriad Pro";
}
#menu li {
color: #fff;
text-decoration: none;
font-family:"Arial Narrow", "Myriad Pro";
}
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);
}
ul li {
font: bold 14px/18px sans-serif;
display: inline-block;
margin-right: -4px;
position: relative;
padding: 15px 20px;
background: #66A366;
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;
}
ul li:hover {
background: #555;
color: #fff;
}
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;
z-index:1000;
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;
}
ul li ul li:hover li{
display: block;
opacity: 1;
visibility: visible;
}
ul li ul li ul li{
padding: 15px 20px;
font: bold 14px/18px sans-serif;
display: none;
position: relative;
top: -48px;
left: 154px;
width: 120px;
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none;
opacity: 0;
z-index:1000;
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;
}
<div id="menu">
<ul>
<li>SCORES
<ul>
<li>ADD SCORES
<ul>
<li>Level 3-A-1</li>
<li>Level 3-A-2</li>
</ul>
</li>
<li>EDIT SCORES</li>
</ul>
</li>
<li>PLAYERS
<ul>
<li>ADD PLAYER</li>
<li>EDIT PLAYERS</li>
</ul>
</li>
<li>COURSES
<ul>
<li>ADD COURSE</li>
<li>EDIT COURSES</li>
</ul>
</li>
<li>ADMIN</li>
</ul>
</div>
Demo FIDDLE
I'm not sure how you want your menu to look like, but I noticed that you forgot to wrap the tabs inside a <ul></ul> tag.
If you do that, the menu will look and behave like what most users would expect.
<div id="menu">
<ul> <-- here
<li>SCORES
// some code
<li>ADMIN</li>
</ul> <-- and here
</div>
You can save your time using Swimbi - Swift Menu Builder
- http://f-source.com/swimbi/
have a look at menu demo