AdBlock Detected!
Our website is made possible by displaying ads to our visitors. Please supporting us by whitelisting our website.
CSS Clear |
The clear property is used to cancel the effect of float. Possible values of the clear property are: Let's take a look at some examples. All examples use the following CSS: CSS declaration:
Example 1 The HTML code below,
renders,
In this case, we cleared both the left float and the right flow, so the third sentence starts below both the first sentence and the second sentence. Example 2 If we do not specify 'clear-both', the layout would look very different: The HTML code,
renders,
In this case, we did not clear either float. Therefore, the third sentence starts in the first available space it can find, which in this case is the 10% gap between the first sentence and the second sentence. Example 3 What if we only clear the float in one direction? Let's take a look at what happens if we only clear the left float: The HTML code below,
renders,
When the left float is cleared, the third sentence starts directly below the first sentence, which had a left float applied to it, but not the second sentence, which had a right float applied to it. |
Our website is made possible by displaying ads to our visitors. Please supporting us by whitelisting our website.