I'm currently making a footer
for my website and met a very unanticipated result. So, I have this footer
with four different menus inside them, acting as the children of the footer
. The menus are each set to width: 25%;
and display: inline-block;
, it should fit perfectly, shouldn't it as 100% divided by 4 is 25%? However, the last menu breaks out of the footer
.
Here's an example of what I'm getting.
As you can see in the example, the journal menu is breaking out of the grid, but the menus are each set to width: 25%;
and display: inline-block;
.
What could possibly be the problem here and how can I solve it without revising my width
of each menu?
I'm more than happy to provide anything to clarify my question if this was not enough.
Here's the relevant code as well.
HTML
<footer class="footer">
<div class="container">
<div class="menu-wrapper">
<div class="menu">
<ul>
<h6 class="peasant">Explore</h6>
<li><a href="#">Our Philosophy</a></li>
</ul>
</div>
<div class="menu">
<ul>
<h6 class="peasant">Services</h6>
<li><a href="#">Offers</a></li>
<li><a href="#">Work</a></li>
</ul>
</div>
<div class="menu">
<ul>
<h6 class="peasant">Contact</h6>
<li><a href="#">Contact Us</a></li>
</ul>
</div>
<div class="menu">
<ul>
<h6 class="peasant">Journal</h6>
<li><a href="#">Blog</a></li>
</ul>
</div>
</div>
</div>
</footer>
CSS
footer.footer {
height: 500px;
width: 100%;
background-color: #f8f8f8;
}
.menu {
width: 25%;
display: inline-block;
vertical-align: top;
white-space: nowrap;
}
.footer .menu ul {
padding: 0;
}
Any clarification of what's happening here would be appreciated as well!