CSS Study-portrait menu-by HTML and CSS

Source: Internet
Author: User

Http://www.wikihow.com/Create-a-Dropdown-Menu-in-HTML-and-CSS

Html

<div id="Leftmenu"> <ul> <li><a href="#">Home</a></li> <liclass='has-sub'><a href="#">PRODUCTS</a> <ul> <liclass='has-sub'><a href="#">sub product1</a> <ul> <liclass='no-sub'><a href="#">sub product1-1</a> </li> <liclass='no-sub'><a href="#">sub product1-2</a></li> </ul> </li> &lt ; Liclass='no-sub'><a href="#">sub product2</a></li> </ul> </li> </ul> </div>
View Code

Css

<style>/*Starter CSS for flyout Menu*/#leftmenu {padding:0; Margin:0; border:0; } #leftmenu ul, li {list-Style:none; Margin:0; padding:0;                } #leftmenu ul {position:relative; Z-index:597; float: Left; } #leftmenu ul li {float: Left;                    height:38px; Line-height:38px;                    width:200px; Vertical-Align:middle; } #leftmenu ul Li.hover, #leftmenu ul li:hover {position:re                        lative; Z-index:599; Cursor:default;                    } #leftmenu ul ul {Visibility:hidden;                    Position:absolute; Top: -%; Left:0; Z-index:598; Width: -%; } #leftmenu ul ul li {float: none; } #leftmenu ul Li:hover>ul {visibility:visible; } #leftmenu ul ul {top:0; Left: -%; } #leftmenu ul li {float: none; }        /*Custom Stuff*/#leftmenu {Border-radius:5px; Background-clip:padding-box; Box-shadow:0 02px 1px Rgba (0,0,0,0.15);        width:160px; } #leftmenu span, #leftmenu a {display:inline-Block; Font-family:arial, Helvetica, sans-serif; Font-size:12px; Text-Decoration:none; Border-bottom:solid 1px Rgba (0,0,0,0.15); } #leftmenu: After, #leftmenu ul:after {content:"';                Display:block;            Clear:both; } #leftmenu> UL >Li ul ul {border-radius:06PX 6px0; Background-clip:padding-box; Background-color: #ffffff; } #leftmenu ul, #leftmenu li {background-color: #4cb6ea; Font-Weight:bold; Width: -%;                } #leftmenu li {height:25px; Line-height:25px;                } #leftmenu A {color: #ffffff; Line-height: the%;                padding:8px 20px 8px 20px;                width:120px; Font-size:16px; } #leftmenu a:hover {color: #666;                Background: #ffffff;                } #leftmenu ul ul {width:160px;                border:1px solid #dddddd;            Background: #ffffff;                } #leftmenu ul ul li {background: #ffffff; } #leftmenu ul ul li a {color: #666;                        } #leftmenu ul ul li a:hover {color: #ff006e; } #leftmenu. has-Sub {position:relative; } #leftmenu ul. has-Sub A:before {display:block; Content:"";                BORDER:6PX solid Transparent; Border-left-color: #eee; Z-index:2; Height:0; Width:0;                Position:absolute;                right:12px; Top:-2px; } #leftmenu. has-sub:hover A:before {border-left-color: #666; } #leftmenu. has-Sub:hover ul Li A:before {display:none; } #leftmenu. has-sub:hover. has-Sub A:before {display:block; } #leftmenu. has-sub:hover. has-sub:hover A:before {border-left-color: #ff006e; } #leftmenu. has-sub:hover. has-Sub:hover ul Li A:before, #leftmenu. No-Sub A:before, #leftmenu. No-sub:hover A:before {display:none; }    </style>
View 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.