One of the major problems with the structure of HTML is that if you have a child div inside parent div, the child div automatically flows around the parent div. The solution to this problem is using clear property of CSS.
Bootstrap allows us to use a class named clearfix which is used to clear the floated contents inside any container.
Example 1: Without clearfix property. In the below program two buttons are floated to left and right.
Clearfix property clear all the floated content of the element that it is applied to. It is also used to clear floated content within a container.
Example 2: With clearfix property. Without using the clearfix class, the parent div may not wrap around the children button elements properly and can cause a broken layout.
- What is a clearfix?
- Include Bootstrap in AngularJS using ng-bootstrap
- What's new in Bootstrap v4.3 ?
- Bootstrap | Spinners Set-2
- Bootstrap 4 | Tables
- Bootstrap 4 | Cards
- Typography in Bootstrap
- Bootstrap | Spinners Set-1
- Bootstrap 4 | Spinners
- Bootstrap 4 | Badges
- Bootstrap 4 | Jumbotron
- Bootstrap 4 | Images
- Bootstrap 4 | Alerts
- Bootstrap 4 | Forms
- Bootstrap 4 | Dropdowns
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.