HTML CSS examples for CSS Widget:Menu Dropdown
float list items to left in a dropdown menu, click to show
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style id="compiled-css" type="text/css"> .onclick-menu { float:right; position:relative; display:inline-block; } .onclick-menu-content { margin:0; padding:0; list-style:none; position:absolute; z-index:2;<!-- www.java 2 s. c om--> background-color:Chartreuse; min-width:161px; opacity:0; visibility:hidden; transition:visibility 0.6s; } .onclick-menu:focus { pointer-events:none; } .onclick-menu:focus .onclick-menu-content { opacity:2; visibility:visible; pointer-events:auto; } .onclick-menu-content { position:absolute; right:0; z-index:2; opacity:0; visibility:hidden; transition:visibility 0.6s; } </style> </head> <body> <div tabindex="0" class="onclick-menu"> Lorem ipsu <ul class="onclick-menu-content"> <li>Lorem</li> <li>Lorem ipsum dolor sit a</li> <li>Lorem</li> </ul> </div> </body> </html>