Home  >  Article  >  Web Front-end  >  An introduction to HTML

An introduction to HTML

不言
不言Original
2018-04-27 14:02:481452browse

The content introduced in this article is an introduction to HTML, which has certain reference value. Now I share it with everyone. Friends in need can refer to it

##HTML Introduction

HTML is a language used to describe web pages.

·HTML refers to HyperText Markup Language: HyperText Markup Language

·HTML is not a programming language, but A markup language

·Markup language is a set of markup tags

·HTML uses markup tags to describe web pages

·HTML documents contain HTML tags and text content

## ·HTML documents are also called web pages

HTML document suffix## .html

.htm

There is no difference between the above two suffixes and both can be used.

HTML example

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>自学教程(lengyuezuixue.com)</title>
</head>
<body>
 
<h1>我的第一个标题</h1>
 
<p>我的第一个段落。</p>
 
</body>
</html>

Example analysis

·8b05045a5be5764f313ed5b9168a17e6: Declared as an HTML5 document

·The 100db36a723c770d327fc0aef2ce13b1 element is the root element of the HTML page

·The 93f0f5c25f18dab9d176bd4f6de5d30e element contains the metadata of the document

## ·The b2386ffb911b14667cb8f0f91ea547a7 element describes the title of the document

·The 6c04bd5ca3fcae76e30b72ad730ca86d element contains the visible page content

·The 4a249f0d628e2318394fd9b75b4636b1 element defines a headline

## ·c852e9f44254fc96ef7cc6d3d1da32e1 element defines a paragraph

##HTML tag

## HTML markup tag Usually called HTML tag

## ·HTML tag is a keyword surrounded by angle brackets, such as100db36a723c770d327fc0aef2ce13b1 ·HTML tags usually appear in pairs, such as a4b561c25d9afb9ac8dc4d70affff419 and 0d36329ec37a2cc24d42c7229b69747a

## ·The first tag in the tag pair is the start tag. The second tag is the closing tag

·The opening and closing tags are also known as open tags and closing tags

<标签>内容</标签>

HTML Element

"HTML tag" and "HTML element" usually describe the same meaning.

But strictly speaking, an HTML element contains a start tag and an end tag, as shown in the following example:

HTML element:

e388a4556c0f65e1904146cc1a846bee这是一个段落。94b3e26ee717c64999d7867364b1b4a3

HTML 网页结构


    只有 6c04bd5ca3fcae76e30b72ad730ca86d 区域 (白色部分) 才会在浏览器中显示。

1a309583e26acea4f04ca31122d8c535声明

    1a309583e26acea4f04ca31122d8c535声明有助于浏览器中正确显示网页。

   网络上有很多不同的文件,如果能够正确声明HTML的版本,浏览器就能正确显示网页内容。

   doctype 声明是不区分大小写的,以下方式均可:

<!DOCTYPE html> 
<!DOCTYPE HTML> 
<!doctype html> 
<!Doctype Html>

通常声明

HTML 5

<!DOCTYPE html>

HTML 4.01 Strict

这个 DTD 包含所有 HTML 元素和属性,但不包括表象或过时的元素(如 font )。框架集是不允许的。

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

HTML 4.01 Transitional

这个 DTD 包含所有 HTML 元素和属性,包括表象或过时的元素(如 font )。框架集是不允许的。

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

HTML 4.01 Frameset

这个 DTD 与 HTML 4.01 Transitional 相同,但是允许使用框架集内容。

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">

XHTML 1.0 Strict

这个 DTD 包含所有 HTML 元素和属性,但不包括表象或过时的元素(如 font )。框架集是不允许的。结构必须按标准格式的 XML 进行书写。

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

XHTML 1.0 Transitional

这个 DTD 包含所有 HTML 元素和属性,包括表象或过时的元素(如 font )。框架集是不允许的。结构必须按标准格式的 XML 进行书写。

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

XHTML 1.0 Frameset

这个 DTD 与 XHTML 1.0 Transitional 相同,但是允许使用框架集内容。

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">

XHTML 1.1

这个 DTD 与 XHTML 1.0 Strict 相同,但是允许您添加模块(例如为东亚语言提供 ruby 支持)。

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

注意

    对于中文网页需要使用 ff94e7be1619a095952b0217c283b66c 声明编码,否则会出现乱码。有些浏览器会设置 GBK 为默认编码,则你需要设置为 0ca43f658d6b9305e97e2cf175e0cde1

The above is the detailed content of An introduction to HTML. 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