Hello! I am currently working on a responsive dropdown menu and have a question regarding the width of the child li elements. Is it possible to make all the child li elements have the same width as the longest child li element? If so, what do I need to change in my code?
If you would like to take a look at the code, I have uploaded it to jsfiddle. The crucial part can be found at the bottom under "WIDE: Nav".
Here is the HTML:
<nav id="twNav-s1" class="twNav twNav-vertical twNav-left">
<ul>
<li>
<div class="nav-sep"></div>
<a href="#">Blog</a>
</li>
<li>
<div class="nav-sep"></div>
<a href="#">About</a>
</li>
<li>
<div class="nav-sep"></div>
<a href="#">Media</a>
<ul>
<li>
<div class="nav-sep"></div>
<a href="#">Stuff</a>
</li>
<li>
<div class="nav-sep"></div>
<a href="#">StuffStuff</a>
</li>
<li>
<div class="nav-sep"></div>
<a href="#">StuffStuffStuff</a>
</li>
</ul>
</li>
<li>
<div class="nav-sep"></div>
<a href="#">Contact</a>
</li>
<li>
<div class="nav-sep"></div>
</li>
</ul>
</nav>
And here is the CSS:
.twNav {
background: rgb(86,107,132);
-webkit-box-shadow: 13px 0px 51px -28px rgba(0,0,0,0.75), inset 13px 0px 51px -28px rgba(0,0,0,0.75);
-moz-box-shadow: 13px 0px 51px -28px rgba(0,0,0,0.75), inset 13px 0px 51px -28px rgba(0,0,0,0.75);
box-shadow: 13px 0px 51px -28px rgba(0,0,0,0.75), inset 13px 0px 51px -28px rgba(0,0,0,0.75);
border-right: 1px solid #8aa5c7;
position: fixed;
opacity: 0.97;
}
.twNav a {
display: block;
color: #fff;
font-size:13.5pt;
font-weight: 300;
text-decoration:none;
text-shadow: 0px 1px 1px rgba(0, 0, 0, 1);
}
/* More CSS styles... */