The difference between Clear:both and Flaot:none in CSS

Source: Internet
Author: User
To put it simply:
1.clear:both is intended to allow the elements of a floating element to be unaffected by floats.
2.float:none is to let child elements do not inherit the floating effect of the parent element.

Clear:both to keep floating content from affecting other labels, so clear floating
Float:none: I have used it a few times because I have used float:left, or float:right, but because it is a control or a common style, if you change it, you can use Float:none to overwrite the original style.
So I don't know if I can understand it, it's better to have an example.

For beginners, use float to clear.

. C-lr{clear:both;height:0px;width:auto;font-size:0px;line-height:0px;visibility:hidden; border:0px;}


Further research can be avoided with clear.

Float:none? What do you do with it?

The two are different, float:none; the selected element does not float; clear:both; no floating elements around the selected element.

Say, clear:float; what is this? I've never seen ...

Clear has a value of four:

None: Allow floating objects on both left and right sides;

Both: the left and right sides are not allowed to have floating objects;

Left: No floating object is allowed

Right: No floating objects are allowed on the left.

Clear:left|right|both, removing the effects of floating, not saying clear float.

Related Article

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.