Basic structure of HTML documents (basic knowledge of making web pages)

Basic structure of HTML documents (basic knowledge of making web pages)

HTML operation principle:

1. Local operation: open the html file with a browser

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

It is best not to have Chinese characters in the web page file name, because web page files will be saved on the server in the future. 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: All web page files usually consist of the following four pairs of tags to form the document skeleton


Copy code
The code is as follows:

<html>
<head>
<title>Webpage title</title>
</head></p> <p><body>
This is where you put the content to be displayed on the web page
</body>
</html>

<html>....</html>: marks the beginning and end of a web page. All HTML elements must be placed between these tags.
<head>....</head>: identifies the header information of the web page file, such as title, search engine keywords, etc. The content inside is loaded first
<title>....</title>: Identifies the title of the web page file
<body>....</body>: identifies the main body of the web page file, that is, the visible content of the page

2. Meta tags

The meta tag is used to define file information and describe the web page to facilitate search engine search. It should be placed between <head> <head/>

Set keywords: (short, for search engines)
<meta name="keywords" content="value"/> value indicates the keyword to be set. Multiple keywords are separated by "," and description is set: (used to expand keywords or give an overview of the content of the web page)
<meta name="description" content="value"/> value indicates the description to be set. Multiple descriptions are separated by , to set the author:
<mate name="author" content="作者名" />The author name is usually the company name. Set the code for the web page:
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
Set the page to jump at a fixed time:
<meta http-equiv="refresh" content="2;url=http://www.baidu.com" /> (content="2;url=http://www.baidu.com" 2 indicates that the webpage will jump to the destination specified by the url after a certain number of seconds)

Describes 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 everyone to visit!">

Describes what software the web page was created with:
<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="Web design, learn web pages" />
<meta name="description" content="How to learn web design, methods of learning web design, HTML Chinese manual" />
<meta name="author" content="123WORDPRESS.COM" />
<meta http-equiv="refresh" content="2;url=http://www.baidu.com" />
<meta name="revised" content="html4.01">
<title>HTML document basic structure_meta tag</title>
</head>
<body>
The meta tag is used to define file information and describe the web page to facilitate search engine search.
</body>
</html>

3. Head area

Copy code
The code is as follows:

<head>
<title>Web page title</title>File title declaration<mate>Some document information, such as the document keywords, description, character set settings, etc.
<base> Hyperlink URL base reference point
JavaScript and VBScript Programs
stylesheet can be used to set the layout declaration
<link> can reference external files, such as CSS layout samples
</head>

3. Syntax of HTML tags

The most basic syntax of HTML is <tag>content</tag>. Tags are usually used in pairs: an opening tag and an ending tag. There is also a single tag without an ending tag, such as <hr/>

HTML tag types: single tag and double tagDouble tag:
With attributes: <tag name attribute="attribute value">...</tag name> For example: <font size="3">.....</font>
No attributes: <tag name>...</tag name> For example: <title>.....</title>

Single marker:
With attributes: <tag name attribute="attribute value"> For example: <hr width="200"/> (the default is centered)
No attributes: <tag name> For example: <br />


Copy code
The code is as follows:

<!-- With attributes: <tag name attribute="attribute value">...</tag name> For example: <font size="3">.....</font>-->
<font size="4" color="#33FF00">2. The physical education teacher said: Anyone who dares to wear a skirt to my class will be punished by standing upside down! </font> </p> <p><!--Without attributes: <tag name>...</tag name> For example: <title>.....</title>--></p> <p><!--With attributes: <tag name attribute="attribute value"> For example: <hr width="200"/> (the default is centered)-->
<hr width="200"/></p> <p><!--No attribute: <tag name> Such as:
Indicates a line break but not a paragraph break--></p> <p>3. Live in my heart, have you paid the rent?
4. You made me lose face, so I won’t even give you a chance to get back on stage.

<<:  Implementing login page based on layui

>>:  Linux operation and maintenance basic process management and environment composition analysis

Recommend

Detailed explanation of count(), group by, order by in MySQL

I recently encountered a problem when doing IM, a...

Summary of Linux ps and pstree command knowledge points

The ps command in Linux is the abbreviation of Pr...

Sample code for changing the color of a png image through a CSS3 filter

This method uses the drop-shadow filter in CSS3 t...

JavaScript to achieve simple drag effect

This article shares the specific code of JavaScri...

Do you know how to use the flash wmode attribute in web pages?

When doing web development, you may encounter the...

Docker's health detection mechanism

For containers, the simplest health check is the ...

The pitfall record of case when judging NULL value in MySQL

Table of contents Preface Mysql case when syntax:...

Detailed explanation of Vue development website SEO optimization method

Because the data binding mechanism of Vue and oth...

Example of adding and deleting range partitions in MySQL 5.5

introduce RANGE partitioning is based on a given ...

Detailed process of upgrading gcc (version 10.2.0) under CentOS7 environment

Table of contents Short Introduction 1. Check the...

Detailed explanation of using javascript to handle common events

Table of contents 1. Form events 2. Mouse events ...

Mysql optimization Zabbix partition optimization

The biggest bottleneck of using zabbix is ​​the d...

Steps to enable TLS in Docker for secure configuration

Preface I had previously enabled Docker's 237...

Understanding and example code of Vue default slot

Table of contents What is a slot Understanding of...

A brief analysis of event bubbling and event capture in js

Table of contents 01-Event Bubbling 1.1- Introduc...