Professional Documents
Culture Documents
Float and Clear
Float and Clear
Float and Clear
Clear
PW SKILLS
Topics Covered
● What is float Layout?
● Clear property
PW SKILLS
What is float Layout?
Technique involves Floating elements to the Left or Right of a container element.
PW SKILLS
Example
HTML CSS
Output
PW SKILLS
Clear property
Clear space on left or right side of an floated elements that come before it.
PW SKILLS
Let’s take an example HTML
HTML CSS
<div> .float-left {
<div class="float-left">LEFT</div> float: left;
<div class="float-right">RIGHT</div> width: 170px;
<p class="para"> height: 170px;
Lorem ipsum dolor sit amet, consectetur background-color: rgb(25, 146, 211);
adipiscing elit. Phasellus imperdiet, border: 15px solid rgb(248, 248, 0);
nulla et dictum interdum, nisi lorem font-size: 40px;
egestas odio aliquet<<. }
</p>
</div> .float-right {
float: right;
width: 170px;
height: 270px;
background-color: rgb(25, 146, 211);
border: 15px solid rgb(248, 248, 0);
font-size: 40px;
}
In next 3 slides we will set para element clear property and see the behaviour.
PW SKILLS
Clear property
.para {
clear: none;
}
PW SKILLS
clear:left
.para {
clear: left;
}
PW SKILLS
clear:right
.para {
clear: right;
}
PW SKILLS
clear:right
.para {
clear: both;
}
PW SKILLS
THANK YOU
PW SKILLS