Bootstrap Float and Clearfix Classes - Bootstrap5 Tutorial 23

Published: 06 November 2022
on channel: ChidresTechTutorials
1,227
35

Notes for You:: Bootstrap Float and Clearfix Classes - Bootstrap5 Tutorial 23

float[-*]-start:
- allows us to float child HTML elements to the left in their parent.

float[-*]-end:
- allows us to float child HTML elements to the right in their parent.

clearfix:
- allows us to remove the floating effect on the parent.

* = sm, md, lg, xl



Example Code:

<div class="bg-warning clearfix">
<div style="width:100px; height:100px;" class="bg-primary float-start">
</div>
<div style="width:100px; height:100px;" class="bg-secondary float-start">
</div>
<div style="width:100px; height:100px;" class="bg-success float-start">
</div>
</div>
<br/>
<div class="bg-warning clearfix">
<div style="width:100px; height:100px;" class="bg-primary float-end">
</div>
<div style="width:100px; height:100px;" class="bg-secondary float-end">
</div>
<div style="width:100px; height:100px;" class="bg-success float-end">
</div>
</div>
<br/>
<div class="bg-warning clearfix">
<div style="width:100px; height:100px;" class="bg-primary float-start">
</div>
<div style="width:100px; height:100px;" class="bg-secondary float-start">
</div>
<div style="width:100px; height:100px;" class="bg-success float-end">
</div>
<div style="width:100px; height:100px;" class="bg-info float-end">
</div>
</div>

<br/>
<div class="bg-warning clearfix">
<div style="width:100px; height:100px;" class="bg-primary float-lg-start float-sm-end">
</div>
<div style="width:100px; height:100px;" class="bg-secondary float-lg-start float-sm-end">
</div>
</div>


Complete Code:
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Bootstrap Demo</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="bootstrap/css/bootstrap.min.css" type="text/css" rel="stylesheet">
</head>
<body>

<div class="bg-warning clearfix">
<div style="width:100px; height:100px;" class="bg-primary float-start">
</div>
<div style="width:100px; height:100px;" class="bg-secondary float-start">
</div>
<div style="width:100px; height:100px;" class="bg-success float-start">
</div>
</div>
<br/>
<div class="bg-warning clearfix">
<div style="width:100px; height:100px;" class="bg-primary float-end">
</div>
<div style="width:100px; height:100px;" class="bg-secondary float-end">
</div>
<div style="width:100px; height:100px;" class="bg-success float-end">
</div>
</div>
<br/>
<div class="bg-warning clearfix">
<div style="width:100px; height:100px;" class="bg-primary float-start">
</div>
<div style="width:100px; height:100px;" class="bg-secondary float-start">
</div>
<div style="width:100px; height:100px;" class="bg-success float-end">
</div>
<div style="width:100px; height:100px;" class="bg-info float-end">
</div>
</div>

<br/>
<div class="bg-warning clearfix">
<div style="width:100px; height:100px;" class="bg-primary float-lg-start float-sm-end">
</div>
<div style="width:100px; height:100px;" class="bg-secondary float-lg-start float-sm-end">
</div>
</div>


<script src="jquery/jquery.min.js" type="text/javascript"></script>
<script src="popper/popper.min.js" type="text/javascript"></script>
<script src="bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
</body>
</html>


Note:
- replace < with less-than symbol.
- replace > with greater-than symbol.

=========================================

Follow the link for next video:
   • Bootstrap Flex Container Classes - Bo...  

Follow the link for previous video:
   • Bootstrap Rounded Corner Classes - Bo...  

=========================================

Bootstrap5 Tutorials Playlist:
   • Bootstrap5 Tutorials  

Bootstrap4 Tutorials Playlist:-
   • Bootstrap4 Tutorials  

=========================================
Watch my other useful tutorials:-

Dreamweaver Tutorials Playlist:-
   • Dreamweaver Tutorials  

PHP Tutorials Playlist:-
   • PHP Tutorials  

MySQL Tutorials Playlist:-
   • MySQL Tutorials  

=========================================

Subscribe to our YouTube channel:-
   / chidrestechtutorials  

=========================================
Hash Tags:-
#ChidresTechTutorials #Bootstrap #BootstrapTutorial #Bootstrap5


On this page of the site you can watch the video online Bootstrap Float and Clearfix Classes - Bootstrap5 Tutorial 23 with a duration of hours minute second in good quality, which was uploaded by the user ChidresTechTutorials 06 November 2022, share the link with friends and acquaintances, this video has already been watched 1,227 times on youtube and it was liked by 35 viewers. Enjoy your viewing!