This time I will bring you what are the basic structures of HTML, and what are the precautions when designing the basic structure of HTML. The following is a practical case, let's take a look.
HyperText Markup Language: Hypertext Markup Language
HyperText: Hypertext (text + picture + video + audio + link)
Markup Language: Markup Language
Three major elements of the website
Pictures, Hyperlinks, Text
HTML basic structure
<html> <head> <title>Document</title> </head> <body> I am mossbaoo ! </body> </html>
HTML tags of standard web pages
1.HTML documentDeclaration:
2.Page title :
3. Page encoding:
utf-8 is a multi-language encoding (recommended Use)
gb2312 is the simplified Chinese encoding
4. Page keywords:
Main content of the page:
Note: The meta tag is an auxiliary tag in the HTML language, usually used Optimized for search engines, it is located at the head of the HTML document.
Generate the initial structure of the HTML document
1. The standard structure of HTML5: html:5+Tab key or !+Tab key
The generated result is as follows
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Document</title> </head> <body> </body> </html>
2. Transitional structure of HTML4: html:xt+Tab key
The generated result is as follows
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head> <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> <title>Document</title> </head> <body> </body> </html>
Notes on HTML tags:
• HTML element consists of a start tag and an end tag.
• The text located in the opening and closing tags is the content of the element.
• HTML tags must have a beginning and an end. If it is a tag with no content (empty tag), use /> to end it.
• Tag names are not case-sensitive, but in XHTML tag names must be lowercase.
• Tags have attributes, which are used to represent the nature and characteristics of the tag. Attributes are specified in the opening tag.
I believe you have mastered the methods after reading these cases. For more exciting information, please pay attention to other related articles on the php Chinese website!
Related reading:
Detailed explanation of examples of HTML text formatting
Summary of frequently used tags in html
The basics of HTML editing (a must-read for beginners)
The above is the detailed content of What are the basic structures of HTML?. For more information, please follow other related articles on the PHP Chinese website!