Home  >  Article  >  Web Front-end  >  HTML basic structure analysis

HTML basic structure analysis

王林
王林forward
2021-02-03 11:53:362979browse

HTML basic structure analysis

HTML is called Hypertext Markup Language and is a markup language. It includes a series of tags. These tags can unify the document format on the network and connect scattered Internet resources into a logical whole. HTML text is descriptive text composed of HTML commands. HTML commands can describe text, graphics, animations, sounds, tables, links, etc.

A complete HTML document must contain 3 parts: document declaration, document header and document body. It is they that constitute the skeleton structure of HTML. The document declaration and document header have been introduced respectively before. This article will introduce in detail the basic elements that constitute the HTML skeleton structure. The

HTML

element represents the root (root) of the HTML document. All other elements are descendants of this element. The and tags define the start and end points of the document, and between them are the head and body of the document. The head of the document is defined by the

tag, while the body is defined by the tag

HTML basic structure analysis

[xmlns]

xmlns attribute is used for assignment The document's XML namespace. The default value is "http://www.w3.org/1999/xhtml", which is required in XHTML and optional in HTML

<html xmlns="http://www.w3.org/1999/xhtml">

HEAD

## The # tag is used to define the head of the document, which is a container for all head elements. ; is mostly invisible and describes some basic attributes and information of the document (title and icon can be presented). The sub-elements under the element mainly include six elements: , , <base>, <link>, <style> and <script><p> <title> defines the title of the document and is the only required element in the head section<p>If the <head> tag is omitted in the document, most browsers will automatically create a <head> element <p>More information about the document header can be found here<p>BODY<p></style> represents the main content of the HTML document. In any HTML document, only There is a element

[Default style]

chrome/firefox/safari/IE8+    
    margin:8px;
IE7-    
    margin:15px 10px;

Structure

In the sublime editor, enter !, and then hold down the Tab key to generate a The basic HTML structure is as follows

<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Document</title>
</head>
<body></body>
</html>

In practice, the header structure of a document often needs to carry some common functions, so the HTML structure is more complex and the structure is as follows

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8"/>
    <title>Document</title>
    <meta name="keywords" content=""/>
    <meta name="description" content=""/>
    <meta name="viewport" content="width=device-width"/>
    <link rel="stylesheet" href="5/style.css"/>
    <link rel="shortcut icon" href="ico.ico"/>
</head>
<body></body>
</html>

Related recommendations:

html tutorial

The above is the detailed content of HTML basic structure analysis. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:cnblogs.com. If there is any infringement, please contact admin@php.cn delete