c# .net Adsense ADO.NET Linq Viruses/security asp.net MVC JQuery Angular-js Node-js SEO Java C++ SQL API Networking vb.net .Net Css JavaScript Generics c#.Net entity framework HTML Website host Website Construction Guide HTTP tutorial W3C tutorial Web Services JSON Psychology Ionic framework Angular ReactJS Python Computer Android
Css

Clear floating

| | Css

Make sure the element clears its child elements. This is useful only if you are still using floats to build your layout. Consider using a modern approach with a flexible box layout or grid layout.

HTML CODE

<div class="clearfix">
    <div class="floated">
        float a
    </div>
    <div class="floated">float b</div>
</div>

CSS CODE:

.clearfix::after {
    content: '';
    display: block;
    clear: both;
} 
.floated {
    float: left;
}

DEMOSTRATION: