I'm currently working on a responsive website, and I have encountered an issue with a dropdown menu. When the browser size is reduced to 900px, the menu shifts all the way to the left side. To address this, I added some left padding to keep it off the edge until it reaches 600px. At that point, the menu transforms into a list-block view and the dropdown box disappears. My goal is to find a solution that will maintain the dropdown menu display between 600px and 900px so that it appears correctly under the intended sections. Here is a screenshot illustrating the problem.
Edit: Here's a fiddle link for reference.
Here is my code:
HTML5
<nav>
<nav class="nav-wrapper">
<ul>
<li><a href="index.html">Home</a></li>
<li><a href="appliances.html">Appliances</a></li>
<li><a href="Electronics/index.html">Electronics</a>
<ul>
<li><a href="Electronics/computers.html">Computers</a></li>
<li><a href="Electronics/game_systems.html">Game Systems</a></li>
<li><a href="Electronics/televisions.html">Televisions</a></li>
</ul>
</li>
<li><a href="Furniture/index.html">Furniture</a>
<ul>
<li><a href="Furniture/bedroom.html">Bedroom</a></li>
<li><a href="Furniture/dining_room.html">Dining Room</a></li>
<li><a href="Furniture/living_room.html">Living Room</a></li>
</ul>
</li>
<li><a href="location.html">Location</a></li>
</ul>
</nav>
</nav>
CSS3
/*Default CSS*/
.main-header nav ul ul {
display: none;
}
.main-header nav ul li:hover > ul {
display: block;
}
.main-header nav ul {
background: #efefef;
background: linear-gradient(top, #efefef 0%, #bbbbbb 100%);
background: -moz-linear-gradient(top, #efefef 0%, #bbbbbb 100%);
background: -webkit-linear-gradient(top, #efefef 0%, #bbbbbb 100%);
box-shadow: 0px 0px 9px rgba(0, 0, 0, 0.15);
padding: 0 20px;
border-radius: 10px;
list-style: none;
position: relative;
display: inline-table;
}
.main-header nav ul:after {
content:"";
clear: both;
display: block;
}
// Skip rest of code as it is redundant //
/*Between 600px and 900px*/
.main-header nav ul {
position: relative;
margin: 0 auto;
left: 10%;
}
.main-header nav ul ul {
position: absolute;
top: 100%;
}
I believe the issue lies within these two lines of code, and any assistance in resolving it would be greatly appreciated.