Block and inline, inline and inline-block, block-level and intra-row elements, intra-row replacement and intra-row non-replacement elements, inlineinline-block

Source: Internet
Author: User

Block and inline, inline and inline-block, block-level and intra-row elements, intra-row replacement and intra-row non-replacement elements, inlineinline-block

Block: the default display attribute of block-level elements is block. No matter how much content is in the block, the display attribute is always full;

Inline: by default, the display attribute of the row element is inline. It only occupies the size of the content in the block and does not occupy the whole line;

Inline-block: Change the display attribute of the element in the row to inline-block to control the length and width of the element in the row;

Common block-level elements: div ul ol li dl dt p; common intra-row elements: a B span img input;

The difference between inline-block and block: In simple terms, block-level elements are used to add block-level elements to a row-level element when line breaks are required, do not wrap is to use inline-block.input and img as the replacement element, you can directly control the width and height of the replacement element.

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.