HTML Tag Element classification

Source: Internet
Author: User

In CSS, tag elements in HTML can be divided into three types: block elements, inline elements, and inline block elements .

The most common block elements are:

<div>, <p>,

Features of blocky elements:

1, a block element exclusive row;

2, the block element height, width, bottom margin, Dingbian distance and row height can be set;

3, the width of the block element is not set in the case of its parent element of 100%.

The commonly used inline elements are:

<a>, <span>, <label>, <br>, <em>, <strong>, <i>, <q>, <var>, < Cite>, <code>

Features of inline elements:

1, and other elements in one line;

2, the height of the inline elements, width, bottom margin, Dingbian distance and row height can not be set;

3, the width of the inline element is that it contains the text or the width of the picture, it is not possible to change.

The commonly used inline block elements are:

, <input>

  Converts an inline element to a block element write {Display:block} inside the CSS of the inline element to be converted

Converts a block element to an inline element write {display:inline} in the CSS of the block element to be converted

Converts an element to an inline block element write {Display:inline-block} in the CSS of the element to be converted

HTML Tag 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.