JSFiddle - React, Tailwind, and code Playground

by Takeru Suzuki

HTML

<div class="container clearfix">
    <div class="float"><pre>float: left;
width: 40%;
margin: 20px 10px;</pre></div>
    <div class="non-float"><pre>margin: 40px 0;</pre></div>
</div>

CSS

.container {
    background: silver;
    outline: 1px dotted red;
}

.non-float {
    margin: 40px 0;
    background: orange;
    outline: 1px dotted red;
}

.float {
    float: left;
    width: 40%;
    margin: 20px 10px;
    background: yellow;
    outline: 1px dotted red;
}

.clearfix:before,
.clearfix:after {
    content: "";
    display: table;
}
.clearfix:after {
    clear: both;
}

.clearfix {
    *zoom: 1;
}