Clear: value;
|
Clearfix Property
Sometimes the floated element may be taller than the containing element in that case the element will overflow outside the boundary.
Hence we can use clearfix hack as it is called generally to resolve that problem.
Now we will see Examples -
Example - We will see what an element without and with clearfix property will look like.
HTML -
|
"en"> | "stylesheet" href="sample.css"> |
"stylesheet" href="https://fonts.googleapis.com/css?family=Sofia|Audiowide|Trirong"> |
"stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons"> | |
without clearfixBelow is the element without clearfix property class="one" src="krishnaimage.jpg" alt="lord krishna image" style="width:170px;height:170px;"> Lorem, ipsum dolor sit amet consectetur adipiscing elit. Quod, ducimus ratione fuga maiores eaque fugiat iste optio ut hic harum. "clear:right">With Clearfix
class="clearfix">
class="img2" src="krishnaimage.jpg" alt="lord krishna image" width="170" height="170"> Lorem ipsum dolor sit amet consectetur adipiscing elit. Ab, velit aliquid id aperiam ipsum adipisci porro voluptate sequi ratione vero?
|
CSS -
Output -
HTML Tables