CSS Fragmented Records

Source: Internet
Author: User

1, the understanding of the element floating (float)

When a block element enables a floating property, it is moved out of the default stream queue, even if its parent element is a block element.

If the element does not set the width and height, the default aspect of the element is 0, and even if there are child elements, the height of the child element cannot be changed by the parent element's width-height attribute, and inheritance does not go down from bottom to top. If the child element chooses to float in this case, then the child element is moved out of the parent element's display queue, and the sibling node of the subsequent parent element immediately follows the parent element, not under the floating child element, so the height of the parent element is defined in this case. Object selection floating is the equivalent of changing layers, floating the upper layer, if there is a background will overwrite the parent element of the sibling node.

What is the difference between setting an object to float and setting an object to inline?

If the block element is set to the Display:inline property, the block element is not in a wide-height attribute, only the contents of its element contain the content to reflect his width and height, if there is no content, the width of the high is not reflected.

What is the difference between setting an object to float and setting an object to Inline-block?

If the block element is set to the Display:inline-block property, the Block object layout does not wrap, but the object between the rows cannot be fully filled, and the Inline-block property itself causes a certain amount of space between objects, filled with a newline.

Is it possible to control the same row with a three block element using float?

Of course, the float property is set to move the object out of the original flow arrangement and float freely. Elements that need to be floated need to have the float property set, either left or right. If the element that needs to float has a left or right property that does not have a float set, it does not wrap because the elements of the float property are not moved out of the original flow arrangement and other settings are not in the same layer. The general expression is the floating element line-wrapping arrangement.

2. The object defined by Display:inline is not a wide-height attribute.

3, Ul,ol: Cannot set background color or background picture, need to configure wide height at the same time, otherwise invalid.

4, if there are two child elements inside the parent element, a child element is a block-level element, one is a floating element, then two is the element in the parent element is two lines of emissions, together with the width of the parent element, adaptive height. If the element does not have a height defined by its height, the bounding rectangle is defined, and the border is pulled larger.

CSS Fragmented Records

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.