Anatomy of the Clear property in CSS

Source: Internet
Author: User

Before the interview was asked how to clear the float, the author said the use of the clear properties of the CSS can be cleared, and then the interviewer and ask, clear how to clear the floating, the author silently, because in peacetime when they do not have to figure out where clear should be used.

First we look at the role of clear: W3school says:

So we can see that when we use the clear property, we make clear that the Sisu border boundary of the element that we set the clear property to is just below the margin boundary of the floating element on that edge.

So if we set it to the left, then the clear element will be underneath all the left floating elements above it, and for the right floating element above it, there is no effect on the purge element.

Similarly, if we set to the right to clear, then the clear element will be at all the right floating on top of the element below, for the left floating element above it, there is no effect on the purge element.

Anatomy of the Clear property in CSS

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.