what does clearfix for floats do in css

Solutions on MaxInterview for what does clearfix for floats do in css by the best coders in the world

showing results for - "what does clearfix for floats do in css"
Maja
25 Jan 2020
1/* A clearfix is a way for an element 
2to clear its child elements automatically without any additional markup.
3The clearfix property is generally used in float layouts where elements 
4are floated to be stacked horizontally. ... The clearfix property allows
5a container to wrap its floated children.
6*/
7
8.clearfix {
9  overflow: auto;
10}
Francisco
02 Jan 2021
1.group:after {
2  content: "";
3  display: table;
4  clear: both;
5}
6
7<div class="group">
8  <div class="is-floated"></div>
9  <div class="is-floated"></div>
10  <div class="is-floated"></div>
11</div>