Pure CSS drop-down menu code

Source: Internet
Author: User

<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">

<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 "/>
<title> Simple Pure CSS drop-down menu code </title>
<style>
#sddm
{margin:0 auto;
padding:0;
z-index:30;
Background-color: #F4F4F4;
width:480px;
height:23px;}


#sddm Li
{margin:0;
padding:0;
List-style:none;
Float:left;
Font:bold 12px Arial}


#sddm Li A
{display:block;
margin:0 1px 0 0;
PADDING:4PX 10px;
width:60px;
Background: #5970B2;
Color: #FFF;
Text-align:center;
Text-decoration:none}


#sddm Li A:hover
{background: #49A3FF}


#sddm Div
{Position:absolute;
Visibility:hidden;
margin:0;
padding:0;
Background: #EAEBD8;
border:1px Solid #5970B2}


#sddm Div A
{position:relative;
Display:block;
margin:0;
padding:5px 10px;
Width:auto;
White-space:nowrap;
Text-align:left;
Text-decoration:none;
Background: #EAEBD8;
Color: #2875DE;
font:12px Arial}


#sddm Div a:hover
{background: #49A3FF;
Color: #FFF}
</style>
<!--DD Menu--
<script type= "Text/javascript" >
<!--
var timeout = 500;
var closetimer = 0;
var ddmenuitem = 0;


Open hidden Layer
function Mopen (ID)
{
Cancel Close Timer
Mcancelclosetime ();


Close old layer
if (ddmenuitem) ddmenuitem.style.visibility = ' hidden ';


Get new layer and show it
Ddmenuitem = document.getElementById (ID);
ddmenuitem.style.visibility = ' visible ';


}
Close showed layer
function Mclose ()
{
if (ddmenuitem) ddmenuitem.style.visibility = ' hidden ';
}


Go Close Timer
function Mclosetime ()
{
Closetimer = window.settimeout (mclose, timeout);
}


Cancel Close Timer
function Mcancelclosetime ()
{
if (Closetimer)
{
Window.cleartimeout (Closetimer);
Closetimer = null;
}
}


Close layer when Click-out
Document.onclick = Mclose;
-
</script>


<body style= "Text-align:center" >


<ul id= "SDDM" >
<li><a href= "#" onmouseover= "Mopen (' M1 ')" onmouseout= "Mclosetime ()" >Home</a>
<div id= "M1" Onmouseover= "Mcancelclosetime ()" onmouseout= "Mclosetime ()" >
<a href= "#" >html dropdown</a>
<a href= "#" >dhtml DropDown menu</a>
<a href= "#" >javascript dropdown</a>
<a href= "#" >dropdown menu</a>
<a href= "#" >css dropdown</a>
</div>
</li>
<li><a href= "#" onmouseover= "Mopen (' m2 ')" onmouseout= "Mclosetime ()" >Download</a>
<div id= "m2" onmouseover= "Mcancelclosetime ()" onmouseout= "Mclosetime ()" >
<a href= "#" >asp dropdown</a>
<a href= "#" >pulldown menu</a>
<a href= "#" >ajax dropdown</a>
<a href= "#" >div dropdown</a>
</div>
</li>
<li><a href= "#" onmouseover= "Mopen (' m3 ')" onmouseout= "Mclosetime ()" >Order</a>
<div id= "M3" onmouseover= "mcancelclosetime ()" onmouseout= "Mclosetime ()" >
<a href= "#" >visa Credit card</a>
<a href= "#" >Paypal</a>
</div>
</li>
<li><a href= "#" onmouseover= "Mopen (' M4 ')" onmouseout= "Mclosetime ()" >Help</a>
<div id= "M4" onmouseover= "Mcancelclosetime ()" onmouseout= "Mclosetime ()" >
<a href= "#" >download help file</a>
<a href= "#" >read online</a>
</div>
</li>
<li><a href= "#" onmouseover= "Mopen (' M5 ')" onmouseout= "Mclosetime ()" >Contact</a>
<div id= "M5" onmouseover= "Mcancelclosetime ()" onmouseout= "Mclosetime ()" >
<a href= "#" >E-mail</a>
<a href= "#" >submit Request form</a>
<a href= "#" target= "_blank" >codefans.net</a>
</div>
</li>
</ul>
<div style= "Clear:both" ></div>

<div>http://www.999jiujiu.com/</div>

</body>

Pure CSS drop-down menu code

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.