One problem I have is with the horizontal navigation bar. I have implemented it using flexbox.
I have this nav bar that when I shrink it the list items (which have black border) do not stay within the unordered list container (with purple border)
From what I understand of each flex box should be resized within the parent container using the flex property. However in my case the list items are not being resized within the unordered list container. Here is a picture of what is going on:
Here is my html code:
nav.horizontalNavigation {
width: 100%;
padding: 0;
clear: both;
}
nav.horizontalNavigation ul {
display: flex;
flex-flow: row nowrap;
border: 3px solid purple;
width: 100%;
padding: 0;
margin: 0;
}
nav.horizontalNavigation>ul li {
display: flex;
flex: 1 1 auto;
border: 2px solid black;
background-color: rgb(117, 140, 72);
font-size: 1.3em;
line-height: 2em;
text-transform: uppercase;
list-style-type: none;
}
nav.horizontalNavigation>ul li a {
flex: 1 1 auto;
display: block;
padding-left: 10px;
padding-right: 10px;
color: white;
}
<header>
<nav class="horizontalNavigation">
<ul>
<li><a href="#ll_home.html">HOME</a></li>
<li><a href="#ll_services.html">SERVICES</a></li>
<li><a href="#ll_commercial.html">COMMERCIAL & STRATA</a></li>
<li><a href="#ll_contact.html">CONTACT US</a></li>
<li><a href="#ll_gallery.html">GALLERY</a></li>
</ul>
</nav>
</header>