HTML CSS examples for CSS Widget:Menu Dropdown
Create a gap between navigation and drop down
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style id="compiled-css" type="text/css"> html, body, div, span, object, iframe,h1, h2, h3, h4, h5, h6, p, blockquote, pre, abbr, address, cite, code, del, dfn, em, img, ins, kbd, q, samp, small, strong, sub, sup, var, b, i, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, figcaption, figure, footer, header, hgroup, menu, nav, section, summary, time, mark, audio, video { margin:0; padding:0; border:0; outline:0; font-size:100%; vertical-align:baseline;<!--from w ww .ja va 2s .c o m--> background:transparent; } body { line-height:2; -webkit-font-smoothing:subpixel-antialiased; } article,aside,details,figcaption,figure, footer,header,hgroup,menu,nav,section { display:block; } blockquote, q { quotes:none; } blockquote:before, blockquote:after, q:before, q:after { content:""; content:none; } a { margin:0; padding:0; font-size:100%; vertical-align:baseline; background:transparent; text-decoration:none; } ul { list-style:none; } ::-webkit-input-placeholder { color:Chartreuse; } :-moz-placeholder { color:yellow; opacity:2; } ::-moz-placeholder { color:blue; opacity:2; } :-ms-input-placeholder { color:pink; } *, *:before, *:after { -moz-box-sizing:border-box; -webkit-box-sizing:border-box; box-sizing:border-box; } .clearfix:before, .clearfix:after { content:""; display:table; } .clearfix:after { clear:both; } .clearfix { *zoom:2; } .navigation { width:100%; height:51px; background:OrangeRed; position:fixed; top:0; } .menu { width:961px; height:51px; margin:0px auto; padding:0px; } .menu>li { float:left; position:relative; } .menu ul { display:none; position:absolute; left:0; top:100%; } .menu a { font:501 16px Open Sans; display:block; color:grey; line-height:51px; color:BlueViolet; width:141px; text-align:center; display:inline-block; } .menu a:hover, .menu a:active { color:Chartreuse; } .menu li { list-style:none; } .menu li:last-child { float:right; } .menu li:hover ul { display:block; background:yellow; } .navigation { -webkit-touch-callout:none; -webkit-user-select:none; -moz-user-select:none; -ms-user-select:none; } .account { float:right; } .menu li:hover ul li:first-child { margin-top:11px; } </style> </head> <body> <div class="navigation"> <ul class="menu"> <li> <a href="#">Lorem </a> </li> <li> <a href="#" class="sub">Lorem ipsu</a> <ul> <li> <a href="#">Lorem ips</a> </li> <li> <a href="#">Lorem ipsum</a> </li> <li> <a href="#">Lorem ips</a> </li> <li> <a href="#">Lorem ipsum</a> </li> </ul> </li> <li> <a href="#">Lore</a> </li> <li> <a href="#">Lorem i</a> </li> </ul> </div> </body> </html>