aspdotnet-suresh offers articles and tutorials,csharp dot net, articles and tutorials,VB.NET Articles,Gridview articles,code examples of 2.0 /3.5,AJAX,SQL Server Articles,examples of .net technologies

jQuery Dropdown Menu with CSS | jQuery Menu with Submenu Example

Feb 19, 2013

Here I will explain how to create simple jQuery dropdown menu using CSS with example or  jQuery CSS Menu with Submenu example. jQuery dropdown menu is used to provide better navigation menu for users in website.

In previous articles I explained jQuery Menu with Bounce effect, CSS Tabbed Menu with rounded corners,
jQuery fancy switch on and off effects example, jQuery convert upper case to lower case and many articles relating to jQuery, Now I will explain how to implement jQuery Dropdown menu or menu with submenu using jQuery

To implement dropdown menu we need to write the code like as shown below

<html xmlns="">
<title>jQuery Simple Dropdown Menu or Menu with Submenu</title>
<script src="" type="text/javascript"></script>
<script type="text/javascript">
$(function () {
$('.menu ul li').hover(
function () {
$('.sub_menu', this).stop(true, true).slideDown(); /*slideDown the subitems on mouseover*/
}, function () {
$('.sub_menu', this).stop(true, true).slideUp();  /*slideUp the subitems on mouseout*/
<style type="text/css">
font-family: verdana, Segoe UI;
margin:0 auto;
border: 1px solid #B34C00;
border-radius: 4px; /*To make the corners rounded in IE*/
-moz-border-radius: 4px; /*this is for mozilla*/
-webkit-border-radius: 4px; /*chrome and other browsers*/
box-shadow: 0 1px 1px #dddddd inset;
-moz-box-shadow: 0 1px 1px #dddddd inset;
-webkit-box-shadow: 0 1px 1px #dddddd inset;
.menu ul{
margin: 0px;
list-style: none;
.menu ul li{
display: inline-block;
position: relative;
.menu ul li a{
text-decoration: none;
display: block;
padding:10px 15px;
.menu ul li a:hover{
background-color: #666666;
position: absolute;
background-color: #666666;
display:none; /*hide the subitems div tag initially*/
border-bottom:4px solid #B34C00; /*just to add a little more good look*/
.sub_menu ul li{
.sub_menu ul li a{
text-decoration: none;
display: block;
padding:10px 15px;
.sub_items ul li a:hover{
background-color: #777777;
<div class="menu">
<li><a href="#">Home</a></li>
<li><a href="#">About</a>
<div class="sub_menu">
<li><a href="#">The Company</a></li>
<li><a href="#">The Website</a></li>
<li><a href="#">The author</a></li>
<li><a href="#">Tutorials</a>
<div class="sub_menu">
<li><a href="#"> Tutorials</a></li>
<li><a href="#">Jquery Tutorials</a></li>
<li><a href="#">Sql Tutorials</a></li>
<li><a href="#">Other tutorials</a></li>
<li><a href="#">Contact</a></li>
<li><a href="#">Advertise</a></li>
Live Demo

To check for live demo mouse hover on below menu 

If you enjoyed this post, please support the blog below. It's FREE!

Get the latest,, VB.NET, jQuery, Plugins & Code Snippets for FREE by subscribing to our Facebook, Twitter, RSS feed, or by email.

subscribe by rss Subscribe by RSS subscribe by email Subscribe by Email


Anonymous said...
This comment has been removed by a blog administrator.
Mossad@1962 said...

hi........ added this menu in my html site but is is not working in IE
so what is the solution for that?

Suma said...

Hi suresh please help me

I have my Review page, in that 3 fields are there.

review title, Description, and Destination.

When I click submit button, if user is already loggedin, that review will insert in to sql database, otherwise login model popup window will open.

If he/she add credentials, it has to go that review page.

Please help me with jQuery modal popup window.
How to write condition in button code ?

I wrote this button_click:
Collapse | Copy Code
if(Request.QueryString["userid"] != null)
//insert code..


Irtekaz Ahmed Khan said...

can submenu to in submenu?

Anonymous said...

on tab (safari),after clicking on subitem, slid down is not working.

Unknown said...

Hi, I want add sub menu dynamically(using code behind), please help me...


sir i want to remove first node i.e. root node in menu control (in asp menu control)... help

ramandeep said...

thank u very much sir.nice blog..

Anonymous said...

For submenu hover..please correct this

.sub_items ul li a:hover{ with .sub_menu ul li a:hover{

Anonymous said...

please change sub_items with sub_menu ...unless it looks great

Give your Valuable Comments

Note: Only a member of this blog may post a comment.

© 2015 All Rights Reserved.
The content is copyrighted to Suresh Dasari and may not be reproduced on other websites without permission from the owner.