Within my Bootstrap container, I have 4 divs that are dynamically rendered and centered on the page. However, there are instances where only 3 divs are rendered, causing the remaining content within the container to float left due to the float tag in the CSS. How can I ensure that these 3 paragraphs remain centered instead of floating left?
<div class="expertise_section text-center">
<div class="row">
<div class="container">
<h2>Centered Headline</h2>
<div class="expertise_section_inner row">
</div>
...
The provided CSS is as follows:
@charset "utf-8";
.expertise_section {
padding: 85px 0;
}
.expertise_section h2 {
font-weight:500;
margin-top:7px;
}
.expertise_div {
float: left;
width: 24.2%;
margin-right:1.05%;
}
...
You can view a working example on jsfiddle here.