Display: inline, inline-block, and block elements

Source: Internet
Author: User

Block Element display: Block

1. I am a block-level element and always start in a new row.

2. width, height, row height, and top and bottom can be controlled. (The default value is 100% of the width and height of the container)

3. My vertical adjacent margins are merged. The maximum value is used by default.

Inline element display: inline

1. I am an in-row element, and other elements are on the same line.

2. The width, height, row height, and top and bottom cannot be changed. (The default value is its own width and height)

3. I have upper and lower margins, but my left and right margins won't be merged.

Inline-Block Element(Between inline and block elements)

1. I am an inline-block element, and I am an inline object, but the content in me is presented as a block object. The Inline object next to it is displayed in the same row.

2. width, height, row height, and top and bottom can be controlled.

3. Like inline elements, there is a gap between the elements by default.

Next articleArticleAs described in:How to remove the spacing between inline-block elements

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.