HTML CSS examples for CSS Widget:Menu Dropdown
Dropdown sub menu auto width
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style id="compiled-css" type="text/css"> body {<!--from ww w. ja v a 2 s.c om--> position:relative; } .dropdown { display:inline-block; margin:0 13px; } .dropdown-content { display:none; position:absolute; background:white; width:auto; padding:13px 17px; z-index:2; } .dropdown:hover .dropdown-content { display:block; } .subm { margin:13px 0; } </style> </head> <body> <div class="dropdown"> <span>Lorem ipsum </span> <div class="dropdown-content"> <div class="subm"> <a class="menulink" href="#ingredients">Lorem ipsum</a> </div> <div class="subm"> <a class="menulink subm" href="#ingredients">Lorem ipsum dolo</a> </div> <div class="subm"> <a class="menulink subm" href="#ingredients">Lorem ipsum dolor</a> </div> <div class="subm"> <a class="menulink subm" href="#ingredients">Lorem ips</a> </div> </div> </div> </body> </html>