Css float, css float

Source: Internet
Author: User

Css float, css float

First, let's talk about float: A floating box can be moved to the left to the right until its outer edge hits the include box or another floating box.

Floating is very important in css styles. Let's take a look at the characteristics of floating:

1. separated from the standard Document Stream (de-standard for short), once an element is out of the standard text stream, the following elements occupy the original position of the floating element, once the element is floating, therefore, you do not have to observe the features of block-level elements and intra-row elements in the Document Stream.

2. element floating will be separated from the document stream, but will not be separated from the text stream, so it will produce a word circle effect.

3. Peer interaction.

Impact of floating:

1. It can make the layout of floating elements messy.

2. Child element floating will affect the parent element.

How to clear floating:

1. Add height to the floating outer element (not recommended)

2. overflow: hidden overflow hidden

3. clear: the impact of both clearing floating.

4. Wall Partitioning Method: ① internal wall method ② external wall method (not only can floating be eliminated, but also the parent element can be given a height)

Possible float values:

1. The left element floats to the left.

2. The right element floats to the right.

3. Default Value of none. The element is not floating and is displayed in the text.

4. inherit specifies that the float attribute value should be inherited from the parent element.

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.