HTML CSS examples for CSS Widget:Menu Dropdown
Constraint width child UL of a LI in a dropdown menu
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style id="compiled-css" type="text/css"> .menu>li { float:left; margin-right:2em; position:relative; } .sub-menu { display:none; position:absolute; width:100%; } .menu>li:hover .sub-menu { display:block; } </style> <!--from w w w .ja v a 2 s . com--> </head> <body> <ul class="menu"> <li> <a>Lorem ipsu</a> <ul class="sub-menu"> <li> <a>Lorem ipsum do</a> </li> <li>Lorem ipsum dol</li> </ul> </li> <li> <a>Lorem ipsum</a> </li> <li> <a>Lorem ips</a> </li> </ul> </body> </html>