Html element classification-grimace

Source: Internet
Author: User
Html element classification-grimace Directory

  • Block-level elements
  • Inline Element
  • Inline block-level elements
  • Summary

I. block-level elements)

Definition: By default,Exclusive rowIs a block-level element.

Features:

  1. Each block-level element starts from a new row, and the subsequent element also starts from another row. (A block-level element excludes one row)
  2. You can set the height, width, row height, and top and bottom margins of an element.
  3. If the element width is not set, it is 100% of its parent container (consistent with the width of the parent element ).

Common block-level elements:

,

,...,

    ,
      ,
      ,
      ,

      2. inline)

      Definition: Inline element, also called intra-Row Element. By defaultSame rowAnd the height and width of the element.Cannot be setIs an inline element.

      Features:

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

      Common inline Elements:,,
      ,,,,,,,,

      3. inline block elements (inline-block)

      Definition: By defaultSame rowAnd the height and width of the element.ConfigurableIs an inline element.

      Features:

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

      Common inline block-level elements:,

      Iv. Summary

      Regardless of the elements, they can all be converted to each other through the display attribute in css.

      ,,

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.