Clear: both in style

Source: Internet
Author: User

clear: Both

" Clear floating "clear is often used in CSS. The typical method is clear: Both;

This is the description in the CSS manual: the value of this attribute indicates that the edge of a floating object is not allowed. This attribute is used to control the physical location of the float attribute in the Document Stream.

when the attribute is set to float, its physical location is already out of the Document Stream, but most of the time we want the Document Stream to recognize float or float The elements after (floating) are not affected by float, so we need to clear them with clear: Both.

for example:

This is the 1st column,

This is the 2nd column,

This is the 3rd column.

If float is not cleared, then the 3rd columns of text will be associated with the 1st and 2 columns of text, so we add a clear floating clear: both in the 3rd columns;

This is the 1st column,

This is the 2nd column,

This is the 3rd column.

generally, we often define a CSS style separately, such as

. clear {

clear: both;

}

then use

to specifically" Clear floating ".

original:

http://blog.sina.com.cn/s/blog_7f854a010100re65.html

example

. clear10 {clear: Both; Height: 10px; overflow: hidden ;}

. yao {float: Left; width: 100px ;}

Hello everyone

I am also very good

Hello everyone

Original article:

Http://zhidao.baidu.com/question/157056984.html

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.