This post is going to discuss the CSS float property. The elements inherit the property values from their parent.
Float property
| Property | Value |
|---|---|
float |
left, right, none, inherit
|
Using this property takes the element out of the page flow and allows its positioning to the left or right side of its container.
Let's consider that we have, an image followed by a paragraph, using the float property will place the image to the left or right of these elements' container.
- Using the value
noneis the default value of thefloatproperty meaning it will display the element in its default position.
Clear property
The clear property defines how to handle the sibling of a floating element.
| Property | Value |
|---|---|
clear |
left, right, both, none, inherit
|
noneis the default value of theclearproperty which states that, no elements that are left or right floated are pushed under a the element.when applied the
leftproperty value, pushes the element under theleftfloated elements.when applied the
rightproperty value, pushes the element under therightfloated elements.when applied the
bothproperty value, pushes the element under bothleft&rightfloated elements.
Top comments (0)