css div ul li drop-down menu code 2_html/css_WEB-ITnose
Reprinted from http://www.fzl-web.com/news/www/JSJL/2008/144.html
< html xmlns ="http://www.w3.org/1999/xhtml" >
< head >
< meta http-equiv ="Content-Type" content ="text/html; charset=utf-8" />
< title > CSS Menu - Horizontal title >
< style type ="text/css" >
body {
margin : 0 ;
padding : 30px ;
background : #FFF ;
color : #666 ;
}
h1 {
font : bold 16px Arial, Helvetica, sans-serif ;
}
p {
font : 11px Arial, Helvetica, sans-serif ;
}
a {
color : #900 ;
text-decoration : none ;
}
a:hover {
background : #900 ;
color : #FFF ;
}
/* CSS Code for Menu Begin: */
/* Root = Horizontal, Secondary = Vertical */
ul#navmenu {
margin : 0 ;
border : 0 none ;
padding : 0 ;
width : 500px ; /* For KHTML */
list-style : none ;
height : 24px ;
}
ul#navmenu li {
margin : 0 ;
border : 0 none ;
padding : 0 ;
float : left ; /* For Gecko */
display : inline ;
list-style : none ;
position : relative ;
height : 24px ;
}
ul#navmenu ul {
margin : 0 ;
border : 0 none ;
padding : 0 ;
width : 160px ;
list-style : none ;
display : none ;
position : absolute ;
top : 24px ;
left : 0 ;
}
ul#navmenu ul li {
float : none ; /* For Gecko */
display : block !important ;
display : inline ; /* For IE */
}
/* Root Menu */
ul#navmenu a {
border : 1px solid #FFF ;
border-right-color : #CCC ;
border-bottom-color : #CCC ;
padding : 0 6px ;
float : none !important ; /* For Opera */
float : left ; /* For IE */
display : block ;
background : #EEE ;
color : #666 ;
font : bold 10px/22px Verdana, Arial, Helvetica, sans-serif ;
text-decoration : none ;
height : auto !important ;
height : 1% ; /* For IE */
}
/* Root Menu Hover Persistence */
ul#navmenu a:hover,
ul#navmenu li:hover a,
ul#navmenu li.iehover a {
background : #CCC ;
color : #FFF ;
}
/* 2nd Menu */
ul#navmenu li:hover li a,
ul#navmenu li.iehover li a {
float : none ;
background : #EEE ;
color : #666 ;
}
/* 2nd Menu Hover Persistence */
ul#navmenu li:hover li a:hover,
ul#navmenu li:hover li:hover a,
ul#navmenu li.iehover li a:hover,
ul#navmenu li.iehover li.iehover a {
background : #CCC ;
color : #FFF ;
}
/* 3rd Menu */
ul#navmenu li:hover li:hover li a,
ul#navmenu li.iehover li.iehover li a {
background : #EEE ;
color : #666 ;
}
/* 3rd Menu Hover Persistence */
ul#navmenu li:hover li:hover li a:hover,
ul#navmenu li:hover li:hover li:hover a,
ul#navmenu li.iehover li.iehover li a:hover,
ul#navmenu li.iehover li.iehover li.iehover a {
background : #CCC ;
color : #FFF ;
}
/* 4th Menu */
ul#navmenu li:hover li:hover li:hover li a,
ul#iehover li.hover li. 🎜> background : #EEE ;
color : #666 ;
}
/* 4th Menu Hover */
ul#navmenu li:hover li:hover li:hover li a:hover,
a:hover {
background : #CCC ;
color : #FFF ;
}
ul#navmenu ul ul,
ul#navmenu ul ul ul {
display : none ;
position : absolute ;
top : 0 ;
left : 160px ;
}
/* Do Not Move - Must Come Before display:block for Gecko */
ul#navmenu li:hover ul ul,
ul ul:ul:
ul#navmenu li.iehover ul ul,
ul#navmenu li.iehover ul ul ul {
display : none ;
}
ul#navmenu ul:hover ul,
ul#navmenu ul ul ul li:hover ul,
ul#navmenu ul ul li:hover ul, ul#navmenu ul li.iehover ul,
ul#navmenu ul ul li.iehover ul {
display : block ;
}
style >
< script type ="text/JavaScript" >
navHover = function () {
var lis = document.getElementById( " navmenu " ).getElementsByTagName( " LI " );
for ( var i = 0 ; i < lis.length; i ) {
lis[i].onmouseover = function () {
this .className = " iehover " ;
}
lis[i].onmouseout = function () {
this .className = this .className.replace( new RegExp( " iehover\b " ), "" );
}
}
}
if (window.attachEvent) window.attachEvent( " onload " , navHover);
script >
head >
< body >
< h1 > CSS Menu - Horizontal h1 >
< hr />
< ul id ="navmenu" >
< li >< a href ="#" > Blog a > li >
< li >< a href ="#" > Work a >
< ul >
< li >< a href ="#" > Websites a >
< ul >
< li >< a href ="#" > qrayg a > li >
< li >< a href ="#" > qArcade a > li >
< li >< a href ="#" > qLoM a > li >
< li >< a href ="#" > qDT a > li >
ul >
li >
< li >< a href ="#" > Pen and Ink a > li >
< li >< a href ="#" > Free Interfaces a > li >
ul >
li >
< li >< a href ="#" > Learn a >
< ul >
< li >< a href ="#" >< font color =red > Fireworks font > a >
< ul >
< li >< a href ="#" > aquaButton a > li >
< li >< a href ="#" > aquaButton2 a > li >
< li >< a href ="#" > waterDrop a > li >
< li >< a href ="#" > lightFX a > li >
< li >< a href ="#" > lightFX2 a > li >
ul >
li >
< li >< a href ="#" > CSS a >
< ul >
< li >< a href ="#" > footerStick a > li >
< li >< a href ="#" > spriteNav a > li >
< li >< a href ="#" > @import a > li >
ul >
li >
ul >
li >
< li >< a href ="#" > Info a > li >
< li >< a href ="#" > Contact a > li >
ul >
body >
html >

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics











HTML is suitable for beginners because it is simple and easy to learn and can quickly see results. 1) The learning curve of HTML is smooth and easy to get started. 2) Just master the basic tags to start creating web pages. 3) High flexibility and can be used in combination with CSS and JavaScript. 4) Rich learning resources and modern tools support the learning process.

WebdevelopmentreliesonHTML,CSS,andJavaScript:1)HTMLstructurescontent,2)CSSstylesit,and3)JavaScriptaddsinteractivity,formingthebasisofmodernwebexperiences.

HTML defines the web structure, CSS is responsible for style and layout, and JavaScript gives dynamic interaction. The three perform their duties in web development and jointly build a colorful website.

AnexampleofastartingtaginHTMLis,whichbeginsaparagraph.StartingtagsareessentialinHTMLastheyinitiateelements,definetheirtypes,andarecrucialforstructuringwebpagesandconstructingtheDOM.

HTML, CSS and JavaScript are the three pillars of web development. 1. HTML defines the web page structure and uses tags such as, etc. 2. CSS controls the web page style, using selectors and attributes such as color, font-size, etc. 3. JavaScript realizes dynamic effects and interaction, through event monitoring and DOM operations.

The roles of HTML, CSS and JavaScript in web development are: 1. HTML defines the web page structure, 2. CSS controls the web page style, and 3. JavaScript adds dynamic behavior. Together, they build the framework, aesthetics and interactivity of modern websites.

The future of HTML is full of infinite possibilities. 1) New features and standards will include more semantic tags and the popularity of WebComponents. 2) The web design trend will continue to develop towards responsive and accessible design. 3) Performance optimization will improve the user experience through responsive image loading and lazy loading technologies.

The future trends of HTML are semantics and web components, the future trends of CSS are CSS-in-JS and CSSHoudini, and the future trends of JavaScript are WebAssembly and Serverless. 1. HTML semantics improve accessibility and SEO effects, and Web components improve development efficiency, but attention should be paid to browser compatibility. 2. CSS-in-JS enhances style management flexibility but may increase file size. CSSHoudini allows direct operation of CSS rendering. 3.WebAssembly optimizes browser application performance but has a steep learning curve, and Serverless simplifies development but requires optimization of cold start problems.
