Detailed CSS box type and Display properties

Source: Internet
Author: User
The box type affects rendering and layout, and there are two basic box types: block-level (block-level) and inline-level (inline-level). In fact there are other types of boxes (such as table, List-item, etc.), but will eventually be treated as block-level box or inline-level box.

The Block box feature is the start of the new line and can contain other block-level box and inline-level box.

Inline-level boxes are elements that cannot form new chunks of content. It does not start with a new line, but it can contain other inline-level boxes and data.

HTML elements and corresponding default box types

Use the Display property of CSS to define the box type, or to change the default box type of an element.

When defining the style attribute Display:none, the box and the other boxes it contains disappear on the browser, instead of creating an invisible box, rather than generating a box at all (that is, the element has no effect on the layout), the derived element does not generate any box, The behavior cannot be overridden by the Diplay property set by the derived element.
For example:

<div style= "Display:none" >     content does not show     <p style= "Display:block" > This content does not display </p> </div>

Property value of Display property and its function description

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.