css dropdown menu shifts website -
css dropdown menu shifts website -
i have dropdown menu on website, , acting buggy, dropdown works, shifts whole website when hovered over.
code pen http://codepen.io/anon/pen/uafdj
#nav { } #nav { background: none repeat scroll 0 0 #585858; border-radius: 3px; height: 50px; margin-bottom: 10px; padding: 0; } #searchbar input[type=text] { background: none repeat scroll 0 0 #fff; border: 1px solid black; height: 25px; padding: 1px 1px 1px 5px; width: 230px; } #searchbar input[type="submit"] { background: none repeat scroll 0 0 #1abc9c; border: 1px solid #12ab8d; color: white; cursor: pointer; font-size: 14px; padding: 4px 15px; } #searchbar { margin-right:10px; } #nav ul { list-style: none outside none; margin: 0; padding: 0 0 0 10px; } #nav ul li { line-height:50px; float:left; } #nav ul li { line-height:50px; font-family:arial, helvetica, sans-serif; font-size:12px; font-weight:400; text-decoration:none; color:#fff; background-color:none repeat scroll 0 0 #585858; display:block; padding:0 20px; } #nav ul ul { background: #5f6975; border-radius: 0px; padding: 0; position: absolute; top: 100%; } #nav ul ul li { float: none; border-top: 1px solid #6b727c; border-bottom: 1px solid #575f6a; position: relative; } #nav ul ul li { padding: 15px 40px; color: #fff; } #nav ul ul li a:hover { background: #4b545f; } #nav ul li a:hover { background-color:#333; } #nav ul li a.active { background-color:#333; } #nav ul li active { background-color:red; } li.active { float: right !important; } li.active_messages { float: right; } #nav ul>li:hover>ul { top:initial; }
my html
<div id="nav"> <ul> <li><a href="index.php">home</a></li> <li><a href="categories.php">categories</a> <ul> <li><a href="#">photoshop</a></li> <li><a href="#">illustrator</a></li> <li><a href="#">web design</a></li> </ul> </li> <li><a href="about.php">about us</a></li> <li><a href="my_profile.php">profile</a></li> <li><a href="my_parts.php">my listings</a></li> <li><a href="verification.php">get verified!</a></li> <li><a href="logout.php">log out</a></li> <li class="active"> <div id="searchbar"> <form action="search.php" method="get"> <input type="text" hidden="" value="product/search" name="route"> <input type="text" required="" placeholder="search..." name="search"> <input type="submit" value="search"> </form> </div></li> </ul> </div>
it bugs when in total screen without ay sidebar stroller. upcoming help.
thank upcoming help , back upwards everyone.
without looking @ code can tell why. width of dropdown moving margin right causing search bar , else underneath dropdown move right.
just create <ul>
list-style-type: none; <li>
display: inline or block;
also you're not setting width search bar, might cause. seek setting width nav.
css drop-down-menu menu
Comments
Post a Comment