Html element types: block-level elements, inline elements (also called intra-row elements), and inline block-level elements ., Element inline

Source: Internet
Author: User

Html element types: block-level elements, inline elements (also called intra-row elements), and inline block-level elements ., Element inline

Tag elements in html are generally divided into three types: block-level elements, inline elements (also called intra-row elements), and inline block-level elements.

Block-level element features:

1. Each block-level element starts from a new row, and the subsequent element also starts from another row. (Overlord, 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 elements include:

<Div>, <p>,

Set display: block. You can convert an element into a block-level element.

Inline element features:

1. and other elements are on one row;

2. The height, width, and top and bottom margins of the element cannot be set;

3. The width of an element is the width of the text or image it contains and cannot be changed.

Common inline elements include:

<A>, <span>, <br>, <I>, <em>, <strong>, <label>, and <q>

Set display: inline. Block elements can be converted to inline elements.

Inline block-level element features:(Both inline and block-level elements are available)


1. and other elements are on one row;

2. You can set the height, width, row height, and top and bottom margins of the element!

Commonly used inline block elements include:

, <input>

Display: inline-block; float: left/right; position: absolute/fixed; you can set the element to an inline block-level 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.