Home  >  Article  >  Web Front-end  >  HTML5 study notes (2) - detailed introduction to elements, attributes, and formatting

HTML5 study notes (2) - detailed introduction to elements, attributes, and formatting

黄舟
黄舟Original
2017-03-16 15:33:381543browse

HTML element


## The element refers to all code from the start tag to the end tag .

Start (open) tagElement contentEnd (close) tage388a4556c0f65e1904146cc1a846beethis is my web page94b3e26ee717c64999d7867364b1b4a3## An HTML element without content is called is an empty element. Empty elements are closed in the opening tag.

0c6dc11e160d3b678d68754cc175188a is an empty element without a closing tag (0c6dc11e160d3b678d68754cc175188a tag definition wraps).

In XHTML,

XML

, and future versions of HTML, all elements must be closed. Adding a slash in the opening tag, such as df250b2156c434f3390392d09b1c9563, is the correct way to close an empty element, and is accepted by HTML, XHTML, and XML.

Even though 0c6dc11e160d3b678d68754cc175188a is valid in all browsers, using df250b2156c434f3390392d09b1c9563 is actually a longer-term guarantee.

HTML element syntax

## The content of element
is the content between the start tag and the end tag

Empty elements are closed in the opening tag

Most HTML elements can have

attributes

Nested HTML elements

Most HTML elements can be nested

<p>Hello world, <a>找度娘</a></p>

HTML attributes 1. Tags can have attributes to provide more information for elements


2. Attributes appear in the form of key-value pairs, such as: href = "www.cnblogs. www/winsoncheung"

3. Commonly used tag attributes:

#  3499910bf9dac5ae3c52d5ede7383485:target specifies where to open the connection

4. Common attributes:

class
Specifies the class name of the element

id
Specifies the unique ID of the element
style Specify the style of the element
title Specify the additional information of the element
<!DOCTYPE html><html><head>
    <meta charset="UTF-8">
    <!--id规定元素唯一ID-->
    <title id="1223">基础</title>
    <!--style规定元素的样式-->
    <style type="text/css"></style></head><body bgcolor="#5f9ea0">
    <h1 align="center">标题1</h1>
    <a href="index02.html" target="_blank">打开本地</a>
    <!--class规定元素类名-->
    <h2 class="h2ID">标题2</h2></body></html>

HTML格式化


文本格式化标签:

标签 描述
a4b561c25d9afb9ac8dc4d70affff419 定义粗体文本。
3d49bde0e0b2e042578ad34140b6c48e 定义大号字。
907fae80ddef53131f3292ee4f81644b 定义着重文字。
5a8028ccc7a7e27417bff9f05adf5932 定义斜体字。
a7f164ed79e1b98df08c174f9f17aff3 定义小号字。
8e99a69fbe029cd4e2b854e244eab143 定义加重语气。
b96cac025db4031319c29e1eb68f19d6 定义下标字。
2cdea26b4c3988e37d674b56660962a7 定义上标字。
426be984ffbbb815d7d88e3543a85d91 定义插入字。
823db3943044a0a9a620ada8d4b1d965 定义删除字。
2e44d2d3284d23d932e1fd85f3d4cf3a 不赞成使用。使用 823db3943044a0a9a620ada8d4b1d965 代替。
533df51242d4fe18c58d599b7d69a4e4 不赞成使用。使用 823db3943044a0a9a620ada8d4b1d965 代替。
88f336217b3880082bb52d49b5de60a5 不赞成使用。使用样式(style)代替。

“计算机输出”标签:

标签 描述
ffbe95d20f3893062224282accb13e8f 定义计算机代码。
5e4e803d53d659f332070b5d4aa430db 定义键盘码。
162cd570ab1483e383d78dcb7f452f7c 定义计算机代码样本。
78f983dbc27872ba42409adefe5049d9 定义打字机代码。
b7f90f73cad438258bf67e62f79b2113 定义变量
e03b848252eb9375d56be284e690e873 定义预格式文本。
376f0e0cc2a52664b61cb416b5964226 不赞成使用。使用 e03b848252eb9375d56be284e690e873 代替。
3ebc223d94886c7b1607d2157549579c 不赞成使用。使用 e03b848252eb9375d56be284e690e873 代替。
43e1fc467495bab219a3286f74139f6a 不赞成使用。使用 e03b848252eb9375d56be284e690e873 代替。

引用、引用和术语定义

标签 描述
8a7974376be5f6c00c121222b727adb9 定义缩写。
eb37297a59d90581fe5571fb4ef859fe 定义首字母缩写。
208700f394e4cf40a7aa505373e0130b 定义地址。
71af07a0e88a1ac1ff73f855702ac153 定义文字方向。
b8a712a75cab9a5aded02f74998372b4 定义长的引用。
1244aa79a84dea840d8e55c52dc97869 定义短的引用语。
f3a85e1241a187c5ac462d886e9a968b 定义引用、引证。
7f9d788ef50b059a7f76f3d2e4ccc9d1 定义一个定义项目。

 代码示例:

<!DOCTYPE html><html><head>
    <meta charset="UTF-8">
    <title id="1223">格式化</title></head><body>
    <b>My name is Winson</b>
    <br/>
    <big>Welcome to my blog~</big>
    <br/>
    <i>Hello, visitor!</i>
    <br/>
    <small>我很小, 你看不见 看不见</small>
    <br/>
    <strong>太显眼了</strong>
    <br/>
    大家好<sub>欢迎</sub>来到    <br/>
    大家好<sup>欢迎</sup>来到    <br/>
    <ins>Come on! girls!</ins>
    <br/>
    <del>Hei! girl!</del></body></html>


The above is the detailed content of HTML5 study notes (2) - detailed introduction to elements, attributes, and formatting. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn