css3 - Is there a way to display a dropdown menu inside/on top of the parent body in pure CSS -
css3 - Is there a way to display a dropdown menu inside/on top of the parent body in pure CSS -
i'm looking create dropdown menu shows inside/on top of parent menu. in pure css. have made quick illustration of looking for(in photoshop). here link. here have now, makes normal dropdown menu , not 1 stays in parent container.
css:
.titlebox ul { text-align: center; font-size: 15px; font-family: arial,sans-serif; line-height: 32px; margin: 0; width: 100%; background: #555; list-style: none; border-radius: 2px !important; transition: 0.15s ease; } .titlebox ul:hover {background: #666;} .titlebox ul:active {background: #444;} .titlebox ul li { display: block; color: #fff; position: relative; width: 100%; height: 32px !important; } .titlebox ul li:hover { background: #666; } .titlebox ul li:hover ul { display: inline; opacity: 1; visibility: visible; } .titlebox ul li ul { padding: 0; position: absolute; top: 0px; right: 0px; display: none; opacity: 0; visibility: hidden; } .titlebox ul li ul li { display: inline; color: #fff; text-shadow: 0 -1px 0 #000; } .titlebox ul li ul li:hover {background: #666;}
html(quick):
<ul> <li>hi<br/> <ul> <li><a href="http://www.google.com">google</a><br/></li> <li>hola<br/></li> <li>halo<br/></li> </ul></li> </ul>
any , help appreciated! know might kinda confusing don't know how else explain it. if have questions, sense free ask!
thanks, usama khan
edit 1: here's link jsfiddle.
i think looking .if not ,can tell me wrong.
class="snippet-code-css lang-css prettyprint-override"> ul { text-align: center; font-size: 15px; font-family: arial, sans-serif; line-height: 32px; margin: 0; padding: 0; width: 300px; background: #555; list-style: none; border-radius: 2px !important; transition: 0.15s ease; } ul:hover { background: #666; } ul:active { background: #444; } ul li { display: block; color: #fff; position: relative; width: 100%; height: 32px !important; } ul li:hover { background: #666; } ul li:hover ul { display: inline; opacity: 1; visibility: visible; margin-left:10px; } ul li ul { padding: 0; position: absolute; top: 0px; right: 0px; display: none; opacity: 0; visibility: hidden; } ul li ul li { display: inline; color: #fff; text-shadow: 0 -1px 0 #000; float: left; width: 33%; } ul li ul li:hover a{ color: white; } ul li ul li:hover { background: #777; }
class="snippet-code-html lang-html prettyprint-override"><body> <ul> <li>hi <ul> <li><a href="http://www.google.com">google1</a></li> <li><a href="http://www.google.com">google2</a></li> <li><a href="http://www.google.com">google3</a></li> </ul> </li> </ul> </body>
css css3 drop-down-menu
Comments
Post a Comment