Home > Article > Web Front-end > 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[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: ,chrome/firefox/safari/IE8+ margin:8px; IE7- margin:15px 10px;StructureIn 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:
The above is the detailed content of HTML basic structure analysis. For more information, please follow other related articles on the PHP Chinese website!