CSS navigation menu, three-level menu implementation code _ navigation menu

Source: Internet
Author: User
CSS navigation menu, three-level menu, complete resources, ultra-practical, I hope you like it.

<! DOCTYPE html PUBLIC "-// W3C // dtd xhtml 1.0 Transitional // EN "" http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd "> <Html xmlns =" http://www.w3.org/1999/xhtml "> <HEAD> <TITLE> CSS navigation </TITLE> <META content =" text/html; charset = gb2312 "http-equiv = Content-Type> <style type =" text/css "> <! -- Body {font: 12px/1.6em Tahoma, Verdana; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; line-height: 16.8px ;}# nav {Z-INDEX: 500; PADDING-BOTTOM: 0px; LIST-STYLE-TYPE: none; MARGIN: 0px; PADDING-LEFT: 0px; PADDING-RIGHT: 0px; HEIGHT: 27px; LIST-STYLE-IMAGE: none; PADDING-TOP: 0px} # nav LI. top {DISPLAY: block; FLOAT: left; HEIGHT: 27px ;}# nav li. top_link {PADDING-BOTTOM: 0px; LINE-HEIGHT: 27px; PADDING-LEFT: 0px; PADDING-RIGHT: 0px; DISPLAY: block; FLOAT: left; HEIGHT: 27px; FONT-SIZE: 12px; CURSOR: pointer; FONT-WEIGHT: bold; TEXT-DECORATION: none; PADDING-TOP: 0px} # nav li. top_link SPAN {PADDING-BOTTOM: 0px; WIDTH: 80px; DISPLAY: block; text-align: center; FLOAT: left; HEIGHT: 27px; PADDING-TOP: 0px} # nav li. top_link SPAN. down {PADDING-BOTTOM: 0px; WIDTH: 80px; DISPLAY: block; text-align: center; BACKGROUND: url (/upload/201011/20101102232944735 .gif) no-repeat right; FLOAT: left; HEIGHT: 27px; PADDING-TOP: 0px} # nav LI: hover. top_link {background-color: # 548bcf; color: # fff2ee;} # nav LI: hover. top_link SPAN {background-color: # 548bcf; color: # fff2ee;} # nav LI: hover. top_link SPAN. down {background-color: # 548bcf; color: # fff2ee; BACKGROUND: url (/upload/201011/20101102232944294 .gif) no-repeat right;} # nav LI: hover {Z-INDEX: 200; POSITION: relative} # nav LI: hover UL. sub {Z-INDEX: 270; BORDER-BOTTOM: # ddd 1px solid; BORDER-LEFT: # ddd 1px solid; PADDING-BOTTOM: 0px; PADDING-LEFT: 0px; WIDTH: 150px; PADDING-RIGHT: 0px; WHITE-SPACE: nowrap; BACKGROUND: # e1ecf6; HEIGHT: auto; BORDER-TOP: # ddd 1px solid; TOP: 27px; BORDER-RIGHT: # ddd 1px solid; PADDING-TOP: 0px; LEFT: 1px} # nav LI: hover UL. sub LI {POSITION: relative; WIDTH: 150px; DISPLAY: block; FLOAT: left; HEIGHT: 19px; FONT-WEIGHT: normal} # nav LI: hover UL. sub li a {BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; LINE-HEIGHT: 19px; TEXT-INDENT: 5px; WIDTH: 150px; DISPLAY: block; HEIGHT: 19px; COLOR: #000; FONT-SIZE: 12px; BORDER-TOP: 0px; BORDER-RIGHT: 0px; TEXT-DECORATION: none} # nav li ul. sub li. fly {BACKGROUND: url (/upload/201011/20101102232944264 .gif) # e1ecf6 no-repeat left center} # nav LI: hover UL. sub li a: hover {BACKGROUND: url (/upload/201011/20101102232944198 .gif) # 548bcf repeat-x center; COLOR: # fff ;}# nav LI: hover UL. sub li. fly: hover {BACKGROUND: url (/upload/201011/20101102232944875 .gif) # 548bcf no-repeat left center; COLOR: # fff} # nav LI: hover UL {Z-INDEX: 400; BORDER-BOTTOM: # ddd 1px solid; BORDER-LEFT: # ddd 1px solid; PADDING-BOTTOM: 0px; PADDING-LEFT: 0px; WIDTH: 150px; PADDING-RIGHT: 0px; WHITE-SPACE: nowrap; BACKGROUND: # e1ecf6; HEIGHT: auto; BORDER-TOP: # ddd 1px solid; TOP:-1px; BORDER-RIGHT: # ddd 1px solid; PADDING-TOP: 0px; LEFT: 144px} # nav LI: hover UL {Z-INDEX: 400; BORDER-BOTTOM: # ddd 1px solid; BORDER-LEFT: # ddd 1px solid; PADDING-BOTTOM: 0px; PADDING-LEFT: 0px; WIDTH: 150px; PADDING-RIGHT: 0px; WHITE-SPACE: nowrap; BACKGROUND: # e1ecf6; HEIGHT: auto; BORDER-TOP: # ddd 1px solid; TOP:-1px; BORDER-RIGHT: # ddd 1px solid; PADDING-TOP: 0px; LEFT: 144px} # nav LI: hover LI: hover UL {Z-INDEX: 400; BORDER-BOTTOM: # ddd 1px solid; BORDER-LEFT: # ddd 1px solid; PADDING-BOTTOM: 0px; PADDING-LEFT: 0px; WIDTH: 150px; PADDING-RIGHT: 0px; WHITE-SPACE: nowrap; BACKGROUND: # e1ecf6; HEIGHT: auto; BORDER-TOP: # ddd 1px solid; TOP:-1px; BORDER-RIGHT: # ddd 1px solid; PADDING-TOP: 0px; LEFT: 144px} # nav LI: hover LI: hover UL {Z-INDEX: 400; BORDER-BOTTOM: # ddd 1px solid; BORDER-LEFT: # ddd 1px solid; PADDING-BOTTOM: 0px; PADDING-LEFT: 0px; WIDTH: 150px; PADDING-RIGHT: 0px; WHITE-SPACE: nowrap; BACKGROUND: # e1ecf6; HEIGHT: auto; BORDER-TOP: # ddd 1px solid; TOP:-1px; BORDER-RIGHT: # ddd 1px solid; PADDING-TOP: 0px; LEFT: 144px} # nav UL {POSITION: absolute; PADDING-BOTTOM: 0px; LIST-STYLE-TYPE: none; MARGIN: 0px; PADDING-LEFT: 0px; WIDTH: 0px; PADDING-RIGHT: 0px; HEIGHT: 0px; TOP:-9999px; LIST-STYLE-IMAGE: none; PADDING-TOP: 0px; LEFT:-9999px} # nav LI: hover UL {POSITION: absolute; PADDING-BOTTOM: 0px; LIST-STYLE-TYPE: none; MARGIN: 0px; PADDING-LEFT: 0px; WIDTH: 0px; PADDING-RIGHT: 0px; HEIGHT: 0px; TOP:-9999px; LIST-STYLE-IMAGE: none; PADDING-TOP: 0px; LEFT:-9999px} # nav LI: hover UL {POSITION: absolute; PADDING-BOTTOM: 0px; LIST-STYLE-TYPE: none; MARGIN: 0px; PADDING-LEFT: 0px; WIDTH: 0px; PADDING-RIGHT: 0px; HEIGHT: 0px; TOP:-9999px; LIST-STYLE-IMAGE: none; PADDING-TOP: 0px; LEFT:-9999px} # nav LI: hover UL {POSITION: absolute; PADDING-BOTTOM: 0px; LIST-STYLE-TYPE: none; MARGIN: 0px; PADDING-LEFT: 0px; WIDTH: 0px; PADDING-RIGHT: 0px; HEIGHT: 0px; TOP:-9999px; LIST-STYLE-IMAGE: none; PADDING-TOP: 0px; LEFT:-9999px} # nav LI: hover UL {POSITION: absolute; PADDING-BOTTOM: 0px; LIST-STYLE-TYPE: none; MARGIN: 0px; PADDING-LEFT: 0px; WIDTH: 0px; PADDING-RIGHT: 0px; HEIGHT: 0px; TOP:-9999px; LIST-STYLE-IMAGE: none; PADDING-TOP: 0px; LEFT:-9999px} # nav LI: hover. fly {BORDER-BOTTOM-COLOR: # fff; BORDER-TOP-COLOR: # fff; BACKGROUND: url (/upload/201011/20101102232944875 .gif) # 548bcf no-repeat left center; COLOR: # fff; BORDER-RIGHT-COLOR: # fff; BORDER-LEFT-COLOR: # fff;} # nav LI: hover. fly {BORDER-BOTTOM-COLOR: # fff; BORDER-TOP-COLOR: # fff; BACKGROUND: url (/upload/201011/20101102232944875 .gif) # 548bcf no-repeat left center; COLOR: # fff; BORDER-RIGHT-COLOR: # fff; BORDER-LEFT-COLOR: # fff;} # nav LI: hover. fly {BORDER-BOTTOM-COLOR: # fff; BORDER-TOP-COLOR: # fff; BACKGROUND: url (/upload/201011/20101102232944875 .gif) # 548bcf no-repeat left center; COLOR: # fff; BORDER-RIGHT-COLOR: # fff; BORDER-LEFT-COLOR: # fff;} # nav LI: hover LI: hover. fly {BORDER-BOTTOM-COLOR: # fff; BORDER-TOP-COLOR: # fff; BACKGROUND: url (/upload/201011/20101102232944875 .gif) # 548bcf no-repeat left center; COLOR: # fff; BORDER-RIGHT-COLOR: # fff; BORDER-LEFT-COLOR: # fff;} # nav LI: hover li. fly {BORDER-BOTTOM-COLOR: # e1ecf6; BORDER-TOP-COLOR: # e1ecf6; BACKGROUND: url (/upload/201011/20101102232944264 .gif) # e1ecf6 no-repeat left center; COLOR: #000; BORDER-RIGHT-COLOR: # e1ecf6; BORDER-LEFT-COLOR: # e1ecf6} # nav LI: hover li. fly {BORDER-BOTTOM-COLOR: # e1ecf6; BORDER-TOP-COLOR: # e1ecf6; BACKGROUND: url (/upload/201011/20101102232944264 .gif) # e1ecf6 no-repeat left center; COLOR: #000; BORDER-RIGHT-COLOR: # e1ecf6; BORDER-LEFT-COLOR: # e1ecf6} # nav LI: hover li. fly {BORDER-BOTTOM-COLOR: # e1ecf6; BORDER-TOP-COLOR: # e1ecf6; BACKGROUND: url (/upload/201011/20101102232944264 .gif) # e1ecf6 no-repeat left center; COLOR: #000; BORDER-RIGHT-COLOR: # e1ecf6; BORDER-LEFT-COLOR: # e1ecf6} --> </style> </HEAD> <BODY> <UL id = nav> <LI class = top> <SPAN> homepage </SPAN> </LI> <LI class = top> <SPAN class = down> about us </SPAN> <UL class = sub> <LI> Company Profile </LI> <LI> Chairman and President </LI> <LI> Development History </LI> <LI> company honor </LI> </UL> </LI> <LI class = top> <SPAN class = down> Products & Services </SPAN> <UL class = sub> <LI> product 1 <UL> <LI> accessories </LI> </ UL> </LI> <LI> product 2 <UL> <LI> product 2-1 </LI> <LI> product 2-2 </LI> </UL> </LI> <LI> service <UL> <LI> service 111 </LI> <LI> service 112 </LI> <LI> Service 113 </LI> <LI> service 114 </LI> <LI> service 115 </LI> </UL> </LI> <LI class = top> <SPAN class = down> News Center </SPAN> <UL class = sub> <LI> announcement </LI> <LI> industry news </LI> </UL> </LI> <LI class = top> <SPAN class = down> Human Resources </SPAN> <UL class = sub> <LI> talent strategy </LI> <LI> social recruitment </LI> <LI> company benefits </LI> </UL> </LI> <LI class = top> <SPAN class = down> partners </SPAN> <UL class = sub> <LI> partner 1 </LI> <LI> partner 2 </LI> <LI> partner 3 </LI> </UL> </LI> <LI class = top> <SPAN> Contact Us </SPAN> </LI> </UL> </BODY> </HTML>
[Ctrl + A select all Note: If you need to introduce external Js, You need to refresh it to execute]

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.