JSFiddle - React, Tailwind, and code Playground
HTML
<div id="main">
<span id="one" class="clearfix">text</span>
<div id="child"></div>
</div>
CSS
#main {
background: lightgreen;
width: 100px;
height: 200px;
}
#one {
float: right;
display: block;
}
#child {
background: red;
width: 100%;
height: 20px;
}
.clearfix:after {
content: " ";
display: table;
clear: both;
}