The difference between the HTML tag element classification

Source: Internet
Author: User

HTML, Hyper Text Markup Language Hypertext Markup language;

Text: plain characters, such as txt text in window

Hypertext: embed styles, images, audio, videos, links, and more in plain text

The basic structure of html:

<! DOCTYPE html>

<title></title>

<body>

</body>

HTML element type:

(1) Block Elements:

    1. Each block-level element begins with a new row, and the element that follows will also have another row. (a Block-level element is exclusive to a single row).
    2. The height, width, row height, and top and bottom margins of an element can be set.
    3. Element width is not set, it is 100% of the parent container (and the width of the parent element), unless the width is set

(2) inline Elements:

    1. And the other elements are all on the same line;
    2. Element height, width, row height, and margins are not set
    3. The height and width of an element depends on the size of the text or Picture it Contains.

(3) inline Block:

    1. and other elements on the same line;
    2. The height, width, row height, and margin of the element can be set

Note: the type of the element can be changed by setting the display Property.

For example:

The differences between the following code and the image reveal the differences between different types of label elements

<! DOCTYPE html>

<meta Charset=u "utf-8" >

<title></title>

<style>

strong,em,a,img{

display:block;

}

h1,h2,p,hr,ul,ol,dl{

display:inline;

}

</style>

<body>

<strong> unparalleled </strong><strong> unparalleled </strong>

<em> Sea-sky </em><em> Sea-sky </em>

<p> Jailbreak </p><p> Jailbreak </p>

<a> Blue sky </a><a> Sky White clouds </a>

<br><br>

<ul><li> through the sky </li></ul><ul><li> through the broken Sky </li></ul>

<ol><li> the dark curtains </li></ol><ol><li> the dark curtains </li></ol>

<dl>

<dt> Computers </dt>

<dd> Lenovo </dd>

<dd> HP </dd>

<dt> Mobile </dt>

<dd> Xiaomi </dd>

<dd> Apple </dd>

</dl>

<details>

<summary></summary>

</details>

<details>

<summary>123</summary>

The ends of the earth are geometric, only for the castle Peak Edge Always.

</details>

</body>

Styles not controlled, default display for each label, 1

Figure 1

is the opposite of their display style, 2

Figure 2

The difference between the 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.