Back-end programmer front-end path 04--html element classification

Source: Internet
Author: User

Directory

    • Block-level elements
    • Inline elements
    • Inline block-level elements
    • Summarize

Block-level elements (blocks)

definition : By default, the element that is exclusive to a row is a block-level element.

features :

    1. Each block-level element begins with a new row, and the subsequent element also starts another line. (True overbearing, one block-level element exclusive row)
    2. The height, width, row height, and top and bottom margins of an element can be set
    3. The element width is not set, and it is 100% of the parent container itself (and the width of the parent element is the same).

common block-level elements :<div>, <p>,

Two, inline elements (inline)

definition : inline element, also called inline element. By default, elements that are not set on the same line as the other elements, and the height, width, and so on of an element are inline elements.

features :

    1. And the other elements are on one line;
    2. The height, width and top and bottom margins of the element are not set;
    3. The width of the element is the width of the text or Picture it contains, and it cannot be changed.

Common inline Elements :<a>, <span>, <br>, <i>, <em>, <strong>, <label>, <q> , <var>, <cite>, <code>

Three, inline block elements (Inline-block)

definition : By default, the elements that can be set on the same line as the other elements and the height, width, etc. of the element are inline elements

features :

    1. And the other elements are on one line;
    2. The height, width, row height, and top and bottom margins of an element can be set.

common inline block-level elements :, <input>

Iv. Summary

Regardless of the element, they can be converted to each other through the display property in CSS.

Back-end programmer front-end path 04--html element classification

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.