If you switch the order of your div
elements, you can get the result that you want as follows.
Float .molo1
to the left and .molo2
to the right.
Keep .molo3
as non-floated content and set the left/right margins to 35%, which is 70% divided by 2, 70% being the width left over after taking into account the width of the central div.
If needed, set margin: 0 auto
to the wrapping element if you need to center it (optional).
#wrap {
width: 100%;
max-width: 1024px;
border: 1px dotted blue;
margin: 0 auto; /* if you want centering */
}
section.yolo {
width: 30%;
max-width: 300px;
}
section.molo1 {
background-color: yellow;
float: left;
}
section.molo2 {
background-color: blue;
float: right;
}
section.molo3 {
background-color: gray;
margin: 0 35%;
}
<div id="wrap">
<section class="yolo molo1">Hello</section>
<section class="yolo molo2">Hi</section>
<section class="yolo molo3">Hey</section>
</div>