HTML CSS examples for CSS Widget:Menu Dropdown
Dropdown Move li to the right in menu
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style id="compiled-css" type="text/css"> #nav {<!--from ww w.j a va 2 s .c o m--> background-color:Chartreuse; padding:0; margin:0; font-family:FONT; font-size:21px; } #wrap { height:100px; } #nav ul { list-style-type:none; padding:0; margin:0; position:relative; min-width:226px; display:flex; align-items:center; } #nav ul li { } #nav ul li:hover { background-color:yellow; } #nav ul li:after { content:""; font-size:0; display:block; height:6px; } #nav ul li:hover:after { background:blue; } #nav ul ul li:hover:after { background:transparent; } #nav ul li a, visited { color:pink; display:block; padding:16px; text-decoration:none; } #nav ul li:hover ul { display:block; } #nav ul ul { display:none; position:absolute; background-color:OrangeRed; border-top:0; margin-top:6px; z-index:11; } #nav ul ul li { display:block; } #nav ul ul li a:hover { color:grey; } #alignright { margin-left:auto; } </style> </head> <body> <div id="nav"> <div id="wrap"> <ul> <li> <a href="home.html">Lore</a> </li> <li> <a href="#">Lorem</a> </li> <li> <a href="#">Lorem</a> <ul> <li> <a href="#">Lorem i</a> </li> <li> <a href="#">Lorem ipsum do</a> </li> <li> <a href="#">Lorem ipsum dolo</a> </li> <li> <a href="#">Lorem ipsum dol</a> </li> </ul> </li> <li> <a href="read.html">Lore</a> </li> <li> <a href="contact.html">Lorem i</a> </li> <li> <a href="about.html">Lorem ip</a> </li> <li id="alignright">Lore</li> <li>Lorem ips</li> <li style="text-align: right;">Lorem i</li> </ul> </div> </div> </body> </html>