Bootstrap Clearfix CSS Helper

 

.clearfix class is used to clear the floats.Resize the browser to see the effect of clearfix.

 
 
 
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Bootstrap css helpers Example</title> <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css"> <script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script> </head> <body> <div class="container-fluid"> <div class="row"> <div class="col-xs-6 col-sm-3" style="background-color:yellow;"> Column 1<br> Resize the browser window to see the effect. Also try to remove the div clearfix line and see what happens. </div> <div class="col-xs-6 col-sm-3" style="background-color:greenyellow;">Column 2</div> <div class="clearfix visible-xs"></div> <div class="col-xs-6 col-sm-3" style="background-color:lightcyan;">Column 3</div> <div class="col-xs-6 col-sm-3" style="background-color:lavender;">Column 4</div> </div> </div> </body> </html>
Output