Comprehensive understanding of HTML basic structure

Comprehensive understanding of HTML basic structure

Introduction to HTML

HyperText Markup Language: Hypertext Markup Language

HyperText: Hypertext (text + pictures + video + audio + links)

Markup Language:

Three elements of a website

Image, hyperlink, text

HTML Basic Structure

XML/HTML CodeCopy content to clipboard
  1. < html >   
  2.      < head >   
  3.          < title > Document </ title >   
  4.      </ head >   
  5.      < body >   
  6. I am mossbaoo!
  7.      </ body >   
  8. </ html >   

Standard HTML tags for web pages

1. HTML document declaration: <!DOCTYPE HTML>

2. Page title: <title>~</title>

3. Page encoding: <meta charset="utf-8" />

UTF-8 is a multi-language encoding (recommended)

gb2312 is the simplified Chinese encoding


4. Page keywords: <meta name="keywords" content="Keyword 1,Keyword 2,…" />

Main content of the page: <meta name="description" content="Content introduction" />

Note: The meta tag is an auxiliary tag of the HTML language, usually used to optimize search engines. It is located in the head of the HTML document.

Generate the initial structure of the HTML document

1. HTML5 standard structure: html:5+Tab key or !+Tab key

The generated results are as follows

XML/HTML CodeCopy content to clipboard
  1. <!DOCTYPE html >   
  2. < html   lang = "en" >   
  3. < head >   
  4.      < meta   charset = "UTF-8" >   
  5.      < title > Document </ title >   
  6. </ head >   
  7. < body >   
  8.        
  9. </ body >   
  10. </ html >   

2. HTML4 transitional structure: html:xt+Tab key

The generated results are as follows

XML/HTML CodeCopy content to clipboard
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >   
  2. < html   xmlns = "http://www.w3.org/1999/xhtml"   xml:lang = "en" >   
  3. < head >   
  4.      < meta   http-equiv = "Content-Type"   content = "text/html; charset=UTF-8" >   
  5.      < title > Document </ title >   
  6. </ head >   
  7. < body >   
  8.        
  9. </ body >   
  10. </ html >   

Note on HTML tags:

• HTML elements consist of start tags and end tags.

• The text enclosed between the start and end 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 properties and characteristics of the tags. Attributes are specified in the opening tag.

The above comprehensive understanding of the basic structure of HTML is all the content that the editor shares with you. I hope it can give you a reference. I also hope that you will support 123WORDPRESS.COM.

Original URL: http://www.cnblogs.com/mossbaoo/archive/2016/07/31/5724065.html

<<:  Implementing a simple Christmas game with JavaScript

>>:  Pure CSS and Flutter realize breathing light effect respectively (example code)

Recommend

How to quickly create tens of millions of test data in MySQL

Remark: The amount of data in this article is 1 m...

Detailed explanation of how Nginx works

How Nginx works Nginx consists of a core and modu...

Mini Program Development to Implement Unified Management of Access_Token

Table of contents TOKEN Timer Refresher 2. Intern...

Introduction to JWT Verification Using Nginx and Lua

Table of contents Preface Lua Script nignx.conf c...

Summary of CSS gradient effects (linear-gradient and radial-gradient)

Linear-gradient background-image: linear-gradient...

Pull-down refresh and pull-up loading components based on Vue encapsulation

Based on Vue and native javascript encapsulation,...

Mysql database recovery actual record by time point

Introduction: MySQL database recovery by time poi...

How to deploy HTTPS for free on Tencent Cloud

Recently, when I was writing a WeChat applet, the...

Docker container operation instructions summary and detailed explanation

1. Create and run a container docker run -it --rm...

CSS3 changes the browser scroll bar style

Note: This method is only applicable to webkit-ba...

my.cnf parameter configuration to optimize InnoDB engine performance

I have read countless my.cnf configurations on th...

JS ES new features template string

Table of contents 1. What is a template string? 2...

MySQL 8.X installation tutorial under Windows

I had been using MySQL 5.7 before, but because My...

JS array deduplication details

Table of contents 1 Test Cases 2 JS array dedupli...

Use native js to simulate the scrolling effect of live bullet screen

Table of contents 1. Basic principles 2. Specific...