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

6 Uncommon HTML Tags

First: <abbr> or <acronym> These two s...

Best tools for taking screenshots and editing them in Linux

When I switched my primary operating system from ...

Vue two same-level components to achieve value transfer

Vue components are connected, so it is inevitable...

CSS3 sample code to achieve element arc motion

How to use CSS to control the arc movement of ele...

Element-ui's built-in two remote search (fuzzy query) usage explanation

Problem Description There is a type of query call...

What is a MySQL index? Ask if you don't understand

Table of contents Overview From Binary Tree to B+...

Steps to set up HTTPS website based on Nginx

Table of contents Preface: Encryption algorithm: ...

Thumbnail hover effect implemented with CSS3

Achieve resultsImplementation Code html <heade...

How to use physics engine joints in CocosCreator

Table of contents mousejoint mouse joint distance...

Basic implementation method of cross-component binding using v-model in Vue

Hello everyone, today we will talk about how to u...

CSS and HTML and front-end technology layer diagram

Front-end technology layer (The picture is a bit e...

Element sample code to implement dynamic table

Table of contents 【Code background】 【Code Impleme...