CSS Dropdown menu tutorial line25.com not working for me -
i'm complete newbie web design , programming , i've been trying make blog page kind of teach myself project. have no particular aim @ point beyond exploring features , working things out myself i'm operating 0 knowledge @ point. found this dropdown menu tutorial end result purportedly this. first tried on blog page project , didn't work, so, decided go through instructions line line replicate effect and, hopefully, in process, discover had gone wrong on first attempt. have followed instructions down colours , styling , yet still doesn't work me! menus won't drop down. using notepad++ , running code notepad++ on firefox. below html , css file. if can tell me going wrong appreciative.
<html> <head> <link rel='stylesheet' href='layout.css'/> </head> <nav> <ul> <li><a href="#">home</a></li> <li><a href="#">tutorials</a></li> <ul> <li><a href="#">photoshop</a></li> <li><a href="#">illustrator</a></li> <li><a href="#">web design</a></li> <ul> <li><a href="#">html</a></li> <li><a href="#">css</a></li> </ul> </li> </ul> </li> <li><a href="#">articles</a></li> <ul> <li><a href="#">web design</a></li> <li><a href="#">user experience</a></li> </ul> </li> <li><a href="#">inspiration</a></li> </ul> </nav> </html> css:
nav ul ul { display:none; } nav ul li:hover > ul { display: block; } nav ul { background: #efefef; background: linear-gradient(top, #efefef 0%, #bbbbb 100%); background: -moz-linear-gradient(top, #efefef 0%, #bbbbb 100%); background: -webkit-linear-gradient(top, #efefef 0%, #bbbbb 100%); box-shadow: 0px 0px 9px rgba (0,0,0,0.15); padding: 0 20px; border-radius: 10px; list-style: none; position: relative; display: inline-table } nav ul:after { content: ""; clear: both; display: block } nav ul li { float: left; } nav ul li:hover { background: #4b545f; background: linear-gradient(top, #4f5964 0%, #5f6975 40%); background: -moz-linear-gradient(top, #4f5964 0%, #5f6975 40%); background: -webkit-linear-gradientlinear-gradient(top, #4f5964 0%, #5f6975 40%); } nav ul li:hover a{ color: #ff } nav ul li { display: block; padding: 25px 40px; color: #757575; text-decoration: none; } nav ul ul { background: #5f6975; border-radius: 0px; padding: 0; position: absolute; top: 100%; } nav ul ul li { float: none; border-top: 1px solid #6b727c; border-bottom: 1px solid #575f6a; position: relative; } nav ul ul li { padding: 15px 40px; color: #fff; } nav ul ul li a:hover { background: #4b545f; } nav ul ul ul { position: absolute; left: 100%; top:0; }
the main problem in html code close li tags "tutorials" , "articles".
these whole element , must not close before including sub lists.
here example:
change:
<li><a href="#">tutorials</a></li> <ul> <li><a href="#">photoshop</a></li> <li><a href="#">illustrator</a></li> <li><a href="#">web design</a></li> <ul> <li><a href="#">html</a></li> <li><a href="#">css</a></li> </ul> </li> </ul> </li> to:
<li><a href="#">tutorials</a> <ul> <li><a href="#">photoshop</a></li> <li><a href="#">illustrator</a></li> <li><a href="#">web design</a> <ul> <li><a href="#">html</a></li> <li><a href="#">css</a></li> </ul> </li> </ul> </li>
Comments
Post a Comment