Basic structure of HTML document (basic knowledge of making web page)

Time:2020-3-24

How HTML works:

1. Local operation: HTML file is opened by browser

2. Remote access operation: local browser accesses remote server (tomcal)

The file name of the web page is better not to have Chinese, because in the future, when the web page files are saved to the server, it is recommended to use English to save HTML files, you can use either. HTM or. HTML file suffix.

2、 Basic structure of HTML document

1. Document skeleton: the skeleton of all web documents, usually composed of the following four pairs of tags

Copy code

The code is as follows:

<html>
<head>
< title > page title < / Title
</head></p>
<p><body>
Here is the content to be displayed in the web page
</body>
</html>

<html>… < / HTML >: marks the beginning and end of a web page. All HTML elements should be placed in this pair of tags
< head >… < / head >: identify the header information of the web page file, such as the title, search engine keywords, etc. the contents are loaded first
< title >… < title >: identifies the title of a web page file
<body>… < / body >: identify the main part of the web page file, that is, the visible content of the page

2. Meta tag

Meta tags are used to define file information and describe Web pages for search engines to find. They should be placed between < head > < head / >

Set Keywords: (shorter, for search engines)
< meta name = “Keywords” content = “value” / > value indicates the keyword to be set. Multiple keywords are separated by
Set Description: (used to extend keywords, or to give an overview of the content of a web page)
< meta name = “description” content = “value” / > value indicates the description to be set, separated by multiple descriptions
Set Author:
< mate name = “author” content = “author name” / > generally, the author name is the company name
To set the encoding for a web page:
<meta http-equiv=”Content-Type” content=”text/html; charset=utf-8″ />
To set the page timing jump:
< meta http equiv = “Refresh” content = “2; url = http://www.baidu.com” / > (content = “2; url = http://www.baidu.com” 2 indicates how many seconds the page has jumped to the destination specified by the URL)

Describe the version of the web page:
<meta name=”revised” content=”html4.01″>
Other web page information can be set:
< meta name = “others” content = “this is my first website. The main contents of the website include animation, music, articles, blogs, etc. welcome to visit! >

The description page is generated by the software:
< meta name = “generator” content = “NOTEPAD” >

Copy code

The code is as follows:

<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “<a href=”http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd</a>”>
<html xmlns=”<a href=”http://www.w3.org/1999/xhtml”>http://www.w3.org/1999/xhtml</a>”>
<head>
<meta http-equiv=”Content-Type” content=”text/html; charset=utf-8″ />
< meta name = “Keywords” content = “webpage design, learn webpage” / >
< meta name = “description” content = “how to learn web design, how to learn web design, HTML Chinese manual” / >
<meta name=”author” content=”developpaer” />
<meta http-equiv=”refresh” content=”2;url=http://www.baidu.com” />
<meta name=”revised” content=”html4.01″>
Basic structure of HTML document
</head>
<body>
Meta tags are used to define file information, describe Web pages, and facilitate search engine search,
</body>
</html>

 

3, head area

Copy code

The code is as follows:

<head>
< title > page title < / Title > document title declaration
< mate > information about some documents, such as keywords, descriptions, character set settings, etc.
< base > hyperlink URL reference point
JavaScript and VBScript programs
Stylesheet can be used to set the typeset declaration
< link > can reference external files, such as CSS typesetting samples
</head>

3、 The syntax of HTML tags

The basic syntax of HTML is < tag > content < / tag >. Tag is usually a start tag and an end tag used in pairs. There is also a single tag without an end tag, such as < HR / >

HTML tag types: single tag and double tag
Double labelling:
There are attributes: < tag name attribute = “attribute value” >… / tag name > for example: < font size = “3” >
No attribute: < tagName >… < tagName > for example: < title >… < title >

Single marker:
There are attributes: < tag name attribute = “attribute value” > for example: < HR width = “200” / > (the default is centered)
No attribute: < tag name > for example: < br / >

Copy code

The code is as follows:

<! — there are attributes: < tag name attribute = “attribute value” >… < tag name > for example: < font size = “3” >… < font > — >
< font size = “4” color = “ff00” > 2. The PE teacher said: whoever dares to wear a skirt in my class will be punished for handstand! </font> </p>
<hr width=”200″/></p>
Line break but not segment — ></p>
4. You’ve left me in the dark. I’ve left you with no chance to go on stage