Introduction to HTML

HTML Introduction

HTML Example

<!DOCTYPE html> 
<html> 
<head> 
<meta charset="utf-8"> 
<title>php中文网(php.cn)</title> 
</head> 
<body> 
<h1>我的第一个标题</h1> 
<p>我的第一个段落。</p> 
</body> 
</html>

Try it»

Example Analysis

1) DOCTYPE declares the document type

2) Located in the tags <html> and </html> describes the document type

3) Located in the tag <body> With </body> for visualizing web content

4) In tags <h1> with </h1> Use as a title

5) In tags <p> with < ;/p> Displayed as a paragraph



##<!DOCTYPE html> The document type is also described in HTML5.


What is HTML?
##HTML is a language used to describe web pages.

1. HTML refers to HyperText Markup Language: HyperText Markup Language

2. HTML is not a programming language, but a markup language

3. Markup Language is a set of markup tags

4. HTML uses markup tags to describe web pages

5. HTML documents contain HTML tags and text content

6. HTML documents are also called web pages

HTML tagsHTML markup tags are often called HTML tags (HTML tags).

1. HTML tags are keywords surrounded by angle brackets, such as <html>

2. HTML tags usually appear in pairs, such as <b> and </ b>

3. The first tag in the tag pair is the start tag, and the second tag is the end tag

4. The start and end tags are also called open tags and closing tags

<tag>content</tag>


# #HTML element

"HTML tag" and "HTML element" usually describe the same meaning.

But strictly speaking, an HTML element contains a start tag With the closing tag, the following example:

HTML element:

<p>This is a paragraph. </p>


Web browser

Web browser (such as Google browser, Internet Explorer, Firefox, Safari) is used to read HTML files and display them as web pages.

The browser does not display HTML tags directly, but you can use tags to decide how to display the content of the HTML page to the user:

1002.png

##HTML web page results


The following is a visual HTML page structure:

1001.png


Only the <body> area (white part) will be displayed in the browser.


##HTML version

Since the birth of the early Internet , there have been many HTML versions:


#Version                

Release Time

#HTML                                                      
##HTML+         1993  

HTML 2.0       1995  

HTML 3.2           1997  

HTML 4.01         1999

XHTML 1.0 2000

HTML5 2012

XHTML5 2013

#<!DOCTYPE> Statement

##< The !DOCTYPE> declaration helps browsers display web pages correctly. There are many different files on the Internet. If the HTML version can be declared correctly, the browser can display the web page content correctly. The doctype declaration is case-insensitive, and the following methods are available:

<!DOCTYPE html>

<!DOCTYPE HTML>

<!doctype html>

<!Doctype Html>



##General declaration

HTML5<!DOCTYPE html>

HTML 4.01

<!DOCTYPE HTML PUBLIC "-//W3C //DTD HTML 4.01 Transitional//EN"

"http://www.w3.org/TR/html4/loose.dtd">

XHTML 1.0

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">

View the complete web declaration type DOCTYPE reference manual.

Chinese encoding

Currently, in most browsers, directly outputting Chinese will cause Chinese garbled characters. At this time, we need Declare the characters as UTF-8 in the header.

HTML Example

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>页面标题</title>
</head>
<body>
<h1>我的第一个标题</h1>
<p>我的第一个段落。</p>
</body>
</html>
Try it »

Continuing Learning
||
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>页面标题</title> </head> <body> <h1>世界一级方程式锦标赛</h1> <p>世界一级方程式锦标赛(FIA Formula 1 World Championship),简称F1,是由国际汽车运动联合会(FIA)举办的最高等级的年度系列场地赛车比赛,是当今世界最高水平的赛车比赛,与奥运会、世界杯足球赛并称为“世界三大体育盛事”。</p> </body> </html>
submitReset Code