I'm trying to create a floated list of items, and these are broken up into 2 sections.
The problem is, the margin I am applying to give some space between to 2 divs is not working correctly, due to the floated items I think.
https://jsfiddle.net/hc7muswj/
I want some space between the first list and the next H2.
How do I make the first div have "solidity" to allow me to margin bottom from it?
.lozzy {
width: 300px;
margin-bottom: 20px !important;
}
.lozzy h2 {
clear: both;
}
.lozzy ul {
padding-left: 0px !important;
}
.lozzy ul li {
width: fit-content;
float: left;
padding: 5px 15px;
border-radius: 5px;
margin-right: 10px;
margin-top: 5px;
margin-bottom: 5px !important;
font-size: 16px!important;
color: #f3f3f3;
background-color: #404040;
display: inline-block;
}
<div class="lozzy">
<h2>Skills</h2>
<ul>
<li>First thing</li>
<li>Second thing</li>
<li>Third thing</li>
<li>Fourth thing</li>
<li>Fifth thing</li>
</ul>
</div>
<div class="lozzy">
<h2>Toolkit</h2>
<ul>
<li>First thing</li>
<li>Second thing</li>
<li>Third thing</li>
<li>Fourth thing</li>
<li>Fifth thing</li>
</ul>
</div>