Home  >  Article  >  Web Front-end  >  Introduction to the basic structure of HTML

Introduction to the basic structure of HTML

迷茫
迷茫Original
2017-03-25 12:23:452684browse

Previous words

 A complete HTML document must contain 3 There are three parts: document declaration, document header and document body. It is these that constitute the skeleton structure of HTML. We have introduced the document declaration and document header respectively. This article will introduce in detail the basic elements that constitute the HTML skeleton structure.

HTML

-

The element represents the root of the HTML document, and all other elements are descendants of this element. The 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 represented by headIntroduction to the basic structure of HTML. The Introduction to the basic structure of HTMLIntroduction to the basic structure of HTML> tag is defined, while the body is defined by the <a href="http://www.php.cn/html/html-HEAD-2.html" target="_blank"> tag</a>

HEAD

Introduction to the basic structure of HTML   The tag is used to define the head of the document, which is a container for all head elements;

is mostly invisible and describes the document. Some basic attributes and information (the ones that can be presented are title and icon). The sub-elements under the element mainly include <meta>, , <base>, <link>, <style></style> and <script></script>this The six elements  <title></title> define the title of the document, which is the only required element in the head section

 If omitted in the document tag, most browsers will automatically create a

element For more information about the document header, go here BODY

represents the main content of the HTML document. In any HTML document, only one

elementIntroduction to the basic structure of HTML is allowed. Introduction to the basic structure of HTMLIntroduction to the basic structure of HTML【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 basic HTML structure. The 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 relatively complex. 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>

The above is the detailed content of Introduction to the basic structure of 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