Create a HTML structure with a main wrapper, inner wrapper, and 2 blocks using display: flex; instead of inline-block for better efficiency.
This method allows you to accomplish the task more quickly and effectively.
Sample HTML:
<div class="wrapper">
<div class="inner-wrapper">
<div class="sectionA">
<p>Content Here</p>
</div>
<div class="sectionB">
<p>More Content Here</p>
</div>
</div>
</div>
Sample CSS:
.wrapper {
width: 100%;
padding: 25px;
background: #666;
}
.inner-wrapper {
width: 100%;
display: flex;
align-items: center;
justify-content: space-between;
padding: 25px;
max-width: 768px;
margin: 0 auto;
}
.sectionA,
.sectionB {
color: #fff;
padding: 10px;
}
VIEW DEMO FIDDLE