Show menu with CSS and fade in - html

My output:
Home  | cat | Info
|sub1
| sub1sub1
| sub1sub2
|sub2
| sub2sub1
<div class="menu" >
<span>
<ul id="nav">
<li><a href="#" >HOME</a></li>
<li>cat
<div class="subs">
<div class="wrp2">
<ul>
<li><a href="#" >sub1</a></li>
<ul>
<li><a href="#" >sub1sub1</a></li>
<li> <a href="#" >sub1sub2</a></li>
</ul>
</ul>
<ul>
<li><a href="#" >sub2</a></li>
<ul><li><a href="#" >sub2sub1</a></li>
</li>
<li>Info</li>
</ul>
</span>
</div>
My CSS:
/* main menu styles */
.menu {
background: none repeat scroll 0px 0px rgba(255, 255, 255, 0.65);
text-align:center;
width:100%;
height:30px;
text-transform: uppercase;
padding-top: 8px;
padding-bottom: 5px;
font-size:19px;
}
.menu > span {
display:inline-block;
margin:0 auto;
}
#nav {
display:inline;
text-align:left;
position:relative;
list-style-type:none;
}
#nav > li {
float:left;
padding:0;
position:relative;
}
#nav > li > a {
color:black;
display:block;
padding:3px 10px;
position:relative;
text-decoration:none;
}
#nav > li > a:hover {
background-color:rgba(255, 255, 255, 0.65);
color:black;
}
#nav > li.selected > a {
z-index:2;
}
#nav li div {
position:relative;
}
#nav li ul a {
font-size: 100%;
color:black;
display:block;
margin-bottom:1px;
padding:3px 5px;
text-decoration:none;
}
#nav li ul a:hover{
background-color:rgba(255, 255, 255, 0.65);
color:black;
}
#nav li div div {
padding:12px 0;
display:none;
margin:0;
position:absolute;
top:6px;
background: none repeat scroll 0px 0px rgba(255, 255, 255, 0.65);
z-index:999;
width:auto;
}
#nav li div div.wrp2 {
width:380px;
}
#nav .sep {
left:190px;
bottom:0;
height:auto;
margin:15px 0;
position:absolute;
top:0;
width:1px;
}
#nav li div ul {
padding-left:10px;
padding-right:10px;
position:relative;
width:170px;
float:left;
list-style-type:none;
}
#nav li div ul li {
margin:0;
padding:0;
}
#nav li div ul li h3 {
color:black;
margin:0 5px 4px;
padding-bottom:3px;
padding-top:3px;
}
#nav li ul ul {
padding:0 0 8px;
padding-left:5px;
}
#nav li ul ul li {
margin:0;
padding:0;
}
#nav li ul ul li a {
font-size: 90%;
color:black;
display:block;
margin-bottom:1px;
padding:3px 5px;
text-decoration:none;
}
#nav li ul ul li a:hover{
background-color:rgba(255, 255, 255, 0.65);
color:black;
}
How can I make cat visible only with CSS and NO jquery. It should be: If I click on cat the submenu should come up. A fade-in/out effect would be great. Is it possible in general?

yes you can do that >
try to make dislay:none to the cat menu . them you must put : hover as dislay:block

ok.
it is east just make an new class to sub menu whit display:none . it means that this block doesn't open it self . after that put another class in : hover and make display that as block

If you want it on click, you can use the :target pseudoclass along with element IDs to control what is visible.
Update the relevant line in your HTML with a link to the ID:
<li id="cat">cat
Then add some simple CSS:
li .subs {
visibility:hidden;
opacity:0;
transition:visibility 0s linear 0.5s,opacity 0.5s linear;
}
li:target .subs {
visibility:visible;
opacity:1;
transition-delay:0s;
}
You will also need to remove any display:none styles that will hide your submenus since we will be using visibility and opacity instead. This allows us to have a nice fade effect.

Related

li id colour issue on dropdown menu

I'm coding a website for uni right now and it's going pretty well, with the exception of a dropdown menu issue. I've given the li property an ID of "selected" on some menu options (when the user is on the page in question), so that it changes colour to a dark pink.
However, the dropdown options underneath whatever has the li id of "selected" all turn dark pink too. When I add a closed li tag at the end of "about" in the html, the dropdown doesn't appear at all.
I'll post the relevant html and CSS as well as screenshots, hopefully someone could help me, please!
THIS is how a dropdown menu (without the id of "selected") looks normally. the links work and it goes slightly darker when i hover over, which is what i want
whereas THIS has the "selected" id. i don't want the dropdown menu this colour - JUST the "about" box
Here's all of the dropdown code:
/*----- Menu Outline -----*/
.menu-wrap {
width:100%;
box-shadow:0px 1px 3px rgba(0,0,0,0.2);
background:#ffeff8;
}
.menu {
width:1000px;
margin:0px auto;
}
.menu li {
margin:0px;
list-style:none;
font-family:"Luna";
text-transform: lowercase;
border:1px solid #ed85c4;
}
.menu a {
transition:all linear 0.15s;
color:#ed85c4;
background:#ffeff8;
}
.menu li:hover > a, .menu .current-item > a {
text-decoration:none;
color:#d771ae;
}
.menu .arrow {
font-size:10px;
line-height:0%;
}
/*----- Top Level -----*/
.menu > ul > li {
float:left;
display:inline-block;
position:relative;
font-size:14px;
}
.menu > ul > li > a {
padding:3px 40px;
display:inline-block;
text-shadow:0px 0px 0px rgba(0,0,0,0.4);
}
.menu > ul > li:hover > a, .menu > ul > a {
background:#f1dae8;
}
.menu > ul > li#selected a{
color: #ffeff8;
background: #c864a1;
}
/*----- Bottom Level -----*/
.menu li:hover .sub-menu {
z-index:1;
opacity:1;
}
.sub-menu {
width:100%;
padding:0px 0px;
position:absolute;
top:100%;
left:0px;
z-index:-1;
opacity:0;
transition:opacity linear 0.15s;
box-shadow:0px 0px 0px rgba(0,0,0,0.2);
}
.sub-menu li {
display:block;
font-size:12px;
text-transform: lowercase;
font-kerning: auto;
}
.sub-menu li a {
padding:10px 30px;
display:block;
background: #ffeff8;
}
.sub-menu li a:hover, .sub-menu a {
background: #f1dae8;
}
<div class="menu-wrap">
<nav class="menu">
<ul class="clearfix">
<li id="selected">
about <span class="arrow">▼</span>
<ul class="sub-menu">
<li>history</li>
<li>values</li>
<li>the truck</li>
<li>produce info.</li>
</ul>
</li>
You did not select correctly the link below the #selected list item.
.menu > ul > li#selected a /*This selects all links below the selected li, including links in child list items*/
should be
.menu > ul > li#selected > a /* this selects the immediate descendent link only */
/*----- Menu Outline -----*/
.menu-wrap {
width:100%;
box-shadow:0px 1px 3px rgba(0,0,0,0.2);
background:#ffeff8;
}
.menu {
width:1000px;
margin:0px auto;
}
.menu li {
margin:0px;
list-style:none;
font-family:"Luna";
text-transform: lowercase;
border:1px solid #ed85c4;
}
.menu a {
transition:all linear 0.15s;
color:#ed85c4;
background:#ffeff8;
}
.menu li:hover > a, .menu .current-item > a {
text-decoration:none;
color:#d771ae;
}
.menu .arrow {
font-size:10px;
line-height:0%;
}
/*----- Top Level -----*/
.menu > ul > li {
float:left;
display:inline-block;
position:relative;
font-size:14px;
}
.menu > ul > li > a {
padding:3px 40px;
display:inline-block;
text-shadow:0px 0px 0px rgba(0,0,0,0.4);
}
.menu > ul > li:hover > a, .menu > ul > a {
background:#f1dae8;
}
.menu > ul > li#selected >a{
color: #ffeff8;
background: #c864a1;
}
/*----- Bottom Level -----*/
.menu li:hover .sub-menu {
z-index:1;
opacity:1;
}
.sub-menu {
width:100%;
padding:0px 0px;
position:absolute;
top:100%;
left:0px;
z-index:-1;
opacity:0;
transition:opacity linear 0.15s;
box-shadow:0px 0px 0px rgba(0,0,0,0.2);
}
.sub-menu li {
display:block;
font-size:12px;
text-transform: lowercase;
font-kerning: auto;
}
.sub-menu li a {
padding:10px 30px;
display:block;
background: #ffeff8;
}
.sub-menu li a:hover, .sub-menu a {
background: #f1dae8;
}
<div class="menu-wrap">
<nav class="menu">
<ul class="clearfix">
<li id="selected">
about <span class="arrow">▼</span>
<ul class="sub-menu">
<li>history</li>
<li>values</li>
<li>the truck</li>
<li>produce info.</li>
</ul>
</li>

CSS Transition not working on nested items

My transition does not apply to the submenu <a> tag. The color change is doing well, but the transition does not trigger on hover. If I apply the same rules, on another element with a main class, it works well. The problem is with nested elements or CSS subclasses/selectors. Any ideas?
I have the following HTML, JS structure & CSS:
$( document ).ready(function() {
$('.menu_container').mouseover(function(e) {
$('ul', this).show();
});
$('.menu_container').mouseout(function(e) {
$('ul', this).hide();
});
});
.menu { background:#f8f8f8; color:#707070; text-align:center; }
.menu li { margin-bottom:0 }
.menu li { display:inline-block; font-size:16px; border-top:2px solid #f8f8f8; }
.menu li:hover { background-color:#022a3b; background-color:#022a3b; border-top:2px solid #06a7ea; text-decoration:none;}
.menu li a { padding:13px 13px 16px 13px; display:block; text-decoration:none; color:#313131; }
.menu li a:hover { color:#06a7ea; }
.menu li span { padding:13px 13px 16px 13px; display:block; text-decoration:none; color:#313131; cursor:pointer; }
.menu li span:hover { color:#06a7ea; }
.menu li.menu_container { position:relative; display:inline-table; }
.menu li.menu_container ul { display:none; position:absolute; top:51px; left:0; background:#022a3b; padding-left:0; padding:5px; }
.menu li.menu_container ul li { display:table; max-width:200px; min-width:130px; text-align:left; border-top:none; margin-left:10px; }
.menu li.menu_container ul li a { color:#FFFFFF; font-size:14px; padding:10px; transition:color 2s; }
.menu li.menu_container ul li a:hover { color:#FF0000; }
<nav class="container-fluid menu">
<ul>
<li>Home</li>
<li>Home</li>
<li class="menu_container">
<span>Home
<ul>
<li>Test</li>
<li>Test</li>
<li>Test</li>
</ul>
</span>
</li>
</ul>
</nav>
Live example: http://thyalie.ro/casedevanzareoradea/
Use jQuery's mouseenter and mouseleave events rather than mouseover and mouseout.
mouseover and mouseout fire every time you hover from one element to another within .menu_container. Therefore, when you hover from one element to a submenu item, the submenu ul's inline style is being rapidly changed from display: none to display: block. This causes the transition on the links to not take effect.
This jQuery page has a good example of the differences between the events.
$( document ).ready(function() {
$('.menu_container').mouseenter(function(e) {
$('ul', this).show();
});
$('.menu_container').mouseleave(function(e) {
$('ul', this).hide();
});
});
.menu { background:#f8f8f8; color:#707070; text-align:center; }
.menu li { margin-bottom:0 }
.menu li { display:inline-block; font-size:16px; border-top:2px solid #f8f8f8; }
.menu li:hover { background-color:#022a3b; background-color:#022a3b; border-top:2px solid #06a7ea; text-decoration:none;}
.menu li a { padding:13px 13px 16px 13px; display:block; text-decoration:none; color:#313131; }
.menu li a:hover { color:#06a7ea; }
.menu li span { padding:13px 13px 16px 13px; display:block; text-decoration:none; color:#313131; cursor:pointer; }
.menu li span:hover { color:#06a7ea; }
.menu li.menu_container { position:relative; display:inline-table; }
.menu li.menu_container ul { display:none; position:absolute; top:47px; left:0; background:#022a3b; padding-left:0; padding:5px; }
.menu li.menu_container ul li { display:table; max-width:200px; min-width:130px; text-align:left; border-top:none; margin-left:10px; }
.menu li.menu_container ul li a { color:#FFFFFF; font-size:14px; padding:10px; transition:color 2s; }
.menu li.menu_container ul li a:hover { color:#FF0000; }
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<nav class="container-fluid menu">
<ul>
<li>Home</li>
<li>Home</li>
<li class="menu_container">
<span>Home
<ul>
<li>Test</li>
<li>Test</li>
<li>Test</li>
</ul>
</span>
</li>
</ul>
</nav>
Your Javascript seems to be interfering with displaying your menu correctly. You do not need any javascript to make this work, however, you can do it on pure CSS, by adding this line:
.menu li.menu_container:hover ul { display: block; }
Because a hover hovers over the parent as well, this works just fine an requires no JS whatsoever.
.menu { background:#f8f8f8; color:#707070; text-align:center; }
.menu li { margin-bottom:0 }
.menu li { display:inline-block; font-size:16px; border-top:2px solid #f8f8f8; }
.menu li:hover { background-color:#022a3b; background-color:#022a3b; border-top:2px solid #06a7ea; text-decoration:none;}
.menu li a { padding:13px 13px 16px 13px; display:block; text-decoration:none; color:#313131; }
.menu li a:hover { color:#06a7ea; }
.menu li span { padding:13px 13px 16px 13px; display:block; text-decoration:none; color:#313131; cursor:pointer; }
.menu li span:hover { color:#06a7ea; }
.menu li.menu_container { position:relative; display:inline-table; }
.menu li.menu_container ul { display:none; position:absolute; top:47px; left:0; background:#022a3b; padding-left:0; padding:5px; }
.menu li.menu_container:hover ul { display: block; }
.menu li.menu_container ul li { display:table; max-width:200px; min-width:130px; text-align:left; border-top:none; margin-left:10px; }
.menu li.menu_container ul li a { color:#FFFFFF; font-size:14px; padding:10px; transition:color 2s; }
.menu li.menu_container ul li a:hover { color:#FF0000; }
<nav class="container-fluid menu">
<ul>
<li>Home</li>
<li>Home</li>
<li class="menu_container">
<span>Home
<ul>
<li>Test</li>
<li>Test</li>
<li>Test</li>
</ul>
</span>
</li>
</ul>
</nav>
Add
transition: color 2s;
to
.menu li.menu_container ul li a:hover

CSS3 Navigation submenu is not inheriting its class

I have been playing with CSS3 trying to really understand it and I have not been able to get the behavior of the sub-menu navigation to be correct. Please see http://jsfiddle.net/jllcpp04/9Jpd6/7/ for a working example. The sub-menu still has the bullet points on it and it is not popping up to the right. This is part of a dynamic menu whose width will change depending upon what offices will appear (based on user profile). I would prefer not to set top/right/left/bottom for div location. I also cannot figure out why derivnav is not overriding the nested submenu.
My HTML Code:
<div class="main_nav">
<ul class="nav">
<li>Home
</li>
<li>
<div class="submenu">Office
<div class="subnav">
<h3>Near You</h3>
<ul>
<li>
<div class="deriv">New York
<div class="derivnav">
<ul>
<li>Upper West Side
</li>
<li>Upper East Side
</li>
<li>Lower West Side
</li>
<li>Wallstreet
</li>
</ul>
</div>
</div>
</li>
</ul>
<h3>Not Near You</h3>
<ul>
<li>chicago
</li>
<li>philadelphia
</li>
<li>san francisco
</li>
</ul>
</div>
</div>
</li>
</ul>
Component CSS:
#charset"utf-8";
/* CSS Document */
.main_nav {
width:56%;
text-align:center;
float:left;
display:inline-block;
}
.nav {
list-style:none;
height:43px;
white-space:nowrap;
margin: 0px auto 10px auto;
min-width:775px;
text-align:left;
}
.nav h3 {
font-size:14px;
margin:7px 0 14px 4px;
padding-bottom:7px;
border-bottom:1px solid #888888;
}
.nav h4 {
font-size:12px;
margin:7px 0 14px 4px;
padding-bottom:7px;
border-bottom:1px solid #888888;
}
.nav > li {
border:none;
text-transform:uppercase;
float:left;
position:relative;
margin:5px 3px 5px 2px;
padding:auto;
}
.nav li {
font-family:Arial, Helvetica, sans-serif;
font-size:14px;
color: #333333;
outline:0;
text-decoration:none;
padding-left:10px;
}
.nav li:hover > a, .nav li:hover > p {
color:#cccc66;
}
.nav li .drop {
padding-right:15px;
background:url("drop-nonsel.png") no-repeat right 4px;
}
.nav li:hover .drop, .nav li .drop:hover {
background:url("drop-sel.png") no-repeat right 4px;
}
.nav .subnav {
float:left;
position:absolute;
text-align:left;
padding:5px;
margin: 5px 5px 5px 0;
border:1px solid #CCC;
border-top:none;
white-space:nowrap;
/* Gradient background */
background:#FFFFFF;
/* Rounded Corners */
-moz-border-radius: 0px 5px 5px 5px;
-webkit-border-radius: 0px 5px 5px 5px;
border-radius: 0px 5px 5px 5px;
opacity:0;
transition:visibility 0s linear 0.2s, opacity 0.2s linear;
visibility:hidden;
}
.nav .submenu:hover .subnav, .nav li .subnav:hover {
top:auto;
opacity:1;
visibility:visible;
}
.nav .subnav > ul {
padding:2px;
margin:0 0 12px 0;
}
.nav .subnav > li {
list-style:none;
border-bottom:thin;
font-size:12px;
line-height:24px;
position:relative;
text-shadow: 1px 1px 1px #ffffff;
padding:0;
margin:0;
float:none;
text-align:left;
}
.nav .subnav > li:last-chid {
border-bottom:none;
}
.deriv li .dropr {
padding-right:10px;
background:url("drop-right-nonsel.png") no-repeat right 6px;
}
.deriv li:hover .dropr, .deriv li .dropr:hover {
background:url("drop-right-sel.png") no-repeat right 6px;
}
.subnav .derivnav {
float:right;
position:absolute;
text-align:left;
right:-150px;
padding:5px;
margin: 5px 5px 5px 0;
border:1px solid #CCC;
border-left:none;
white-space:nowrap;
/* Gradient background */
background:#FFFFFF;
/* Rounded Corners */
-moz-border-radius: 0px 5px 5px 5px;
-webkit-border-radius: 0px 5px 5px 5px;
border-radius: 0px 5px 5px 5px;
opacity:0;
transition:visibility 0s linear 0.3s, opacity 0.3s linear;
visibility:hidden;
}
.subnav .derivnav > li {
list-style:none;
border-bottom:thin;
font-size:12px;
line-height:24px;
position:relative;
text-shadow: 1px 1px 1px #ffffff;
padding:0;
margin:0;
float:none;
text-align:left;
}
.subnav li .deriv:hover .derivnav, .subnav li .derivnav:hover {
top:auto;
opacity:1;
visibility:visible;
}
.derivnav ul {
padding:2px;
margin:0 0 12px 0;
}
.derivnav li {
list-style:none;
border-bottom:thin;
font-size:12px;
line-height:24px;
position:relative;
text-shadow: 1px 1px 1px #ffffff;
padding:0;
margin:0;
float:none;
text-align:left;
}
I have been playing with it for a few days and can't seem to figure it out. my CSS3 validates and my html code does as well. Any ideas?
Thanks!
Jon
It worked for me when I removed the > marks from these two lines:
Old version
.nav .subnav > li {
.nav .subnav > li:last-chid {
New version
.nav .subnav li {
.nav .subnav li:last-child {
The > in a CSS selector means that the selected element must be a direct child of the previous element, not just the nearest descendant. In your markup, .subnav is a div, not a ul. The li element simply wasn't selected before, so you're styles were never applied.
If you need the .subnav list styles to be completely separate from the .deriv styles, you could use the > operator like this:
Alternate
.nav .subnav > ul > li {
My fork of the DEMO
i add DEMO
.nav li a {
font-family:Arial, Helvetica, sans-serif;
font-size:14px;
color: #333333;
outline:0;
text-decoration:none;
padding-left:10px;
}

How to make my to menu screen size independent in CSS

For a top menu of my website I am using a css file. The menu works fine for me but I noticed that on smaller screen the menu breaks down, that two or more item of the menu coming down for lack of space. I tried to modified the different parameter of the css but still it did not work. Can anyone please suggest me for the modification of the following css so that the menu works same in different resolution of devices.
CSS
body {
margin:0px;
}
#nav {
background-color:#262626;
width:100%;
height:50px;
box-shadow: 0px 1px 30px #5E5E5E;
position:fixed;
top:0px;
}
#nav > ul {list-style:inside none; padding:0; margin:0;}
#nav > ul > li {list-style:inside none; padding:5px; margin:0; float:left; display:block; position:relative;}
#nav > ul > li > a{ padding: 10px; outline:none; display:block; position:relative; padding:12px 20px; font: 1em/100% Arial, Helvetica, sans-serif; text-align:center; text-decoration:none; text-shadow:1px 1px 0 rgba(0,0,0, 0.4); }
#nav > ul > li > a:after{ content:''; position:absolute; top:-1px; bottom:-1px; right:-2px; z-index:99; }
#nav ul li.has-sub:hover > a:after{top:0; bottom:0;}
#nav > ul > li.has-sub > a:before{ content:''; position:absolute; top:18px; right:6px; border:5px solid transparent; border-top:5px solid #fff; }
#nav > ul > li.has-sub:hover > a:before{top:19px;}
#nav ul li.has-sub:hover > a{ background:#2198bf; border-color:#3f3f3f; padding-bottom:13px; padding-top:13px; top:-1px; z-index:999; }
#nav ul li.has-sub:hover > ul, #cssmenu_top ul li.has-sub:hover > div{display:block;}
#nav ul li.has-sub > a:hover{background:#2198bf; border-color:#3f3f3f;}
#nav ul li > ul, #cssmenu_top ul li > div{ display:none; width:auto; position:absolute; top:38px; padding:10px 0; background:#3f3f3f; border-radius:0 0 5px 5px; z-index:999; }
#nav ul li > ul{width:200px;}
#nav ul li > ul li{display:block; list-style:inside none; padding:0; margin:0; position:relative;}
#nav ul li > ul li a{ outline:none; display:block; position:relative; margin:0; padding:8px 20px; font:10pt Arial, Helvetica, sans-serif; color:#fff; text-decoration:none; text-shadow:1px 1px 0 rgba(0,0,0, 0.5); }
.title {
color:#FF0000;
padding-top: 8px;
font-family:verdana;
font-size:20px;
width:20px;
margin-top:6px;
margin-left:150px;
font-weight:bold;
float:left;
}
.subtitle {
color:#FF0000;
font-family:verdana;
font-size:15px;
}
#navigation{
list-style-type:none;
}
li {
display:inline;
padding:10px;
}
#nav a{
font-family:verdana;
text-decoration:none;
color:#EDEDED;
}
#nav a:hover {
color:#BDBDBD;
}
#body {
width:98%;
margin:0px auto;
margin-top:80px;
font-family:verdana;
}
hr {
border:1px solid #262626;
}
.menu_extended{
position: fixed;
width: 100%;
height: 5px;
top: 48px;
left: 0px;
background-color: #CC0000;
box-shadow: 0px 1px 30px #5E5E5E;
}
In the body of my html page i am writting the following way for creation of menu:
<div id="nav">
<p class="title">
<span style="color:0000FF;"> </span>
</p>
<ul>
<li><a href="index.php" >Home</a></li>
<li>Reading</li>
<li>Multimedia</li>
<li><a href="test_home.php" >Test Yourself</a></li>
<li>Sit for Exam</li>
<li>Analysis</li>
<li>Tips And Tricks</li>
<li>About</li>
</ul>
</div>
Any help ?
Reponsive menu bar can easily be achieved by media queries.If you don't about them then seach it on google.I am providing you a demo url https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Media_queries.
In this you have to apply css to your menu bar according to width of device
To make a Responsive menu bar and to target each devices. you can use #media queries.
// normal style
#header-image {
background-repeat: no-repeat;
background-image:url('image.gif');
}
// show a larger image when you're on a big screen
#media screen and (min-width: 1200px) {
#header-image {
background-image:url('large-image.gif');
}
}
// remove header image when printing.
#media print {
#header-image {
display: none;
}
}

Where would I add a transition effect in my menu?

I wish to add a transition to my current CSS dropdown menu.
I have my "transition: height ease-in-out 500ms;" code all ready to go, I just need to know where to add it.
How I have my menu setup is like so:
<ul id="nav">
<li>
About Us <img style="border:0;" src="/index_files/darrow.png" />
<ul id="accordion">
<li>Who We Are</li>
<li>Contact Us</li>
<li>Join Us For Worship</li>
<li>Meet Our Staff</li>
</ul>
</li>
</ul>
So, what I am wondering is where I would put my transition code in my .css file to affect the "accordion" section. (I can remove the id="accordion" section, that was just there from testing.
All help is appreciated, thank you.
EDIT: Here is the CSS:
#nav {
font-size:20px;
text-align:center;
position:relative;
z-index:500;
display:block;
margin-bottom:20px;
padding:0;
width:950px;
background:#33A1DE;
float:left;
border-bottom:none;
color:white;
-moz-box-shadow: 0px 5px 10px #333333;
-webkit-box-shadow: 0px 5px 10px #333333;
box-shadow: 0px 5px 10px #333333;
}
#nav a:visited, #nav a {
color:white;
}
#nav li a, #nav li {
float:left;
}
#nav > li {
line-height:2em;
width:20%;
list-style:none;
position:relative;
border-top:none;
border-right:1px solid white;
box-sizing:border-box;
-moz-box-sizing:border-box;
-webkit-box-sizing:border-box;
}
#nav > li.right {
line-height:2em;
width:20%;
list-style:none;
position:relative;
border-right:none;
box-sizing:border-box;
-moz-box-sizing:border-box;
-webkit-box-sizing:border-box;
}
#nav li a {
height:100%;
width:100%;
text-decoration:none;
background:#33A1DE;
}
#nav li a:hover {
background:#000000;
}
/* Submenu */
#nav li ul {
list-style:none;
width:100%;
display:none;
position:absolute;
left:0;
top:100%;
padding:0; margin:0;
}
#nav li ul:last-child {
border-bottom:1px solid white;
}
#nav li:hover > ul {
display:block;
}
#nav li ul li, #nav li ul li a {
float:none;
}
#nav li ul > li {
left:-1px;
text-align:center;
margin:auto;
position:relative;
box-sizing:border-box;
-moz-box-sizing:border-box;
-webkit-box-sizing:border-box;
_display:inline; /* for IE6... God knows why */
}
#nav li ul li a {
display:block;
border:1px solid white;
border-bottom:none;
}
/* Sub-Submenu */
#nav li ul li > ul {
list-style:none;
display:none;
position:absolute;
}
#nav li ul li:hover ul {
border-left:1px solid white;
z-index:5;
left:0px;
top:0px;
left:100%;
width:200px;
}
#nav li ul li ul:last-child {
border-bottom:1px solid white;
}
#nav li ul li:hover ul.youth {
border-left:1px solid white;
z-index:5;
left:0px;
top:-100%;
left:100%;
width:200px;
box-sizing:border-box;
}
Start by deleting the display:none from to the accordion. Then specify a height to the accordion li elements as well as a transition type.
in the :hover state of the About us li, you specify the new height for the accordion li's.
DEMO
You add that directive on the same rule where the height of the menu changes (not the :hover state).
You'll have to provide us with more details if you want a more detailed answer.