Home > Web Front-end > Front-end Q&A > What is the first valid tag in an HTML document

What is the first valid tag in an HTML document

醉折花枝作酒筹
Release: 2021-06-07 13:41:38
Original
2284 people have browsed it

In HTML, the first valid tag is the html tag. This element tells the browser that it is an HTML document. The "" and "" tags define the start and end points of the document, and between them are the head and body of the document.

What is the first valid tag in an HTML document

The operating environment of this tutorial: Windows 7 system, CSS3&&HTML5 version, Dell G3 computer.

Hypertext Markup Language (foreign language abbreviation: HTML) markup tags are often called HTML tags. HTML tags are the most basic unit in the HTML language. HTML tags are HTML (an application under the Standard Universal Markup Language) The most important component.

Definition and Usage

This element tells the browser that it is an HTML document.

and tags define the start and end points of the document, and between them are the head and body of the document. As you know, the head of the document is defined by the

tag, while the body is defined by the tag.

Differences between HTML and XHTML

The xmlns attribute is required in XHTML but not in HTML. However, the W3C validator will not issue an error even if this attribute is not used for in the XHTML document. This is because "xmlns=http://www.w3.org/1999/xhtml" is a fixed value and will be added to the tag even if you don't include it.

Note: Even if the html element is the root element of the document, it does not contain a doctype element. The doctype element must precede the html element.

Attribute value:

What is the first valid tag in an HTML document

Instance:

<html>

<head>
<title>我的第一个 HTML 页面</title>
</head>

<body>
<p>body 元素的内容会显示在浏览器中。</p>
<p>title 元素的内容会显示在浏览器的标题栏中。</p>
</body>

</html>
Copy after login

Effect:

body 元素的内容会显示在浏览器中。
title 元素的内容会显示在浏览器的标题栏中。
Copy after login

Extended information:

Characteristics of the html tag

1. Keywords surrounded by angle brackets, such as

2. Usually appear in pairs, such as and

3. The first tag in the tag pair is the start tag, and the second tag is the end tag;

4. The start and end tags are also Called open tags and closed tags.

5. There are also tags presented separately, such as: What is the first valid tag in an HTML document, etc.

Recommended learning: html video tutorial

The above is the detailed content of What is the first valid tag in an HTML document. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template