Latest web development tutorials

Introduction to HTML

HTML Examples

<! DOCTYPE html> <Html> <Head> <Meta charset = "utf-8"> <Title> This tutorial ( </ title> </ Head> <Body> <H1> My first title </ h1> <P> My first paragraph. </ P> </ Body> </ Html>

try it"

Examples of analytical

  • DOCTYPE declaration document type
  • Located tag <html> and </ html> describes the document type
  • Located tag <body> and </ body> to visualize web content
  • Located tag <h1> and </ h1> is used as a title
  • Located tag <p> and </ p> is displayed as a paragraph
lamp <! DOCTYPE html> HTML5 is also described in the document type.

What is HTML?

HTML is a language used to describe the page.

  • HTML refersHTML: H yper T ext M arkup Language
  • HTML is not a programming language, but amarkup language
  • Markup language is a set ofmarkup tags (markup tag)
  • HTML uses markup tags todescribe web pages
  • HTML documents contain HTMLtags and textcontent
  • HTML document also calledweb pages

HTML tags

HTML markup tags commonly referred to as HTML tags (HTML tag).

  • HTML tags are keywords surrounded by angle brackets like <html>
  • HTML tags normally come in pairs, such as <b> and </ b>
  • Tag on the first tag is the start tag, the second tag is the end tag
  • Start and end tags are also called open-label and closing tag
<Tag> content </ tag>

HTML elements

"HTML tags" and "HTML elements" are often describe the same meaning.

But strictly speaking, an HTML element that contains the start tag and end tag, the following examples:

HTML element:

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

Web Browser

Web browser (such as Google Chrome, Internet Explorer, Firefox, Safari) is to read HTML file and display as a Web page.

Browser does not directly display the HTML tags, but you can use the label to determine how to show the contents of the HTML page to the user:

HTML web results

Here is a visual HTML page structure:

<Title>? Page title </ title>
</ Head>
<H1>? This is a heading </ h1>
<P> This is a paragraph. </ P>
<P>? This is another paragraph. </ P>
</ Body>
</ Html>

Note Only <body>? Region (? White part)? Will be displayed in the browser.

HTML version

From the early days after the birth of the Internet, there have been many versions of HTML:

版本 发布时间
HTML 1991
HTML+ 1993
HTML 2.0 1995
HTML 3.2 1997
HTML 4.01 1999
XHTML 1.0 2000
HTML5 2012
XHTML5 2013

<! DOCTYPE> declaration

<! DOCTYPE> declaration helps the browser to display the page correctly.

There are many different files on the network, if properly declare the HTML version, the browser can display web content correctly.

doctype declaration is not case-sensitive, the following methods can be:

<!DOCTYPE html>


<!doctype html>

<!Doctype Html>

General Statement


<! DOCTYPE html>

HTML 4.01

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


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"

View full page statement type DOCTYPE Reference Manual .

Chinese encoding

Currently in most browsers, directly? Chinese output will be Chinese garbled, this time we need to be at the head of a character declared as UTF-8.

HTML Examples

<! DOCTYPE html> <Html> <Head> <Meta charset = "UTF-8"> <Title> Page Title </ title> </ Head> <Body> <H1> My first title </ h1> <P> My first paragraph. </ P> </ Body> </ Html>

try it"