JSFiddle - React, Tailwind, and code Playground

HTML

CASE 1
<div>
    <div class="float">1</div>
    <div class="float">2</div>
</div>
<div>
    <div>anything other</div>
</div>
CASE 2
<div>
    <div class="float">1</div>
    <div class="float">2</div>
    <div>anything other</div>
</div>

CSS

.float {
    float: left;
}
div:not(.float) {
    clear: both;
}