Introduction to HTML

Introduction to HTML


Now you can build a simple HTML page through an HTML example as follows, so as to have a simple understanding of the structure of HTML.

<!DOCTYPE html>
<html>

<head>
<title>Page Title (iditect.com)</title>
</head><body>
<h1>i am the first title</h1>
<p>I am the first paragraph.</p>
</body>
</html>

instance analysis


  • DOCTYPEdeclares the type of the document
  • <html>The tag is the root element of the HTML page, and the closing tag of the tag is</html>
  • <head>The tag contains the metadata of the document ( meta), such as <meta charset="utf-8">defining the web page encoding format as utf-8.
  • <title>The tag defines the title of the document
  • <body>The tag defines the main body of the document, that is, the content of the page visible to the web page, and the end of the tag is</body>
  • <h1>The tag is used as a title, and the end of the tag is </h1>, -- HTML title
  • <p>The tag is displayed as a paragraph, and the tag ends with the </p>--p tag usage

What is HTML?


HTML language is used to describe web pages.

  • HTML stands for Hypertext Markup Language : Hyper Text Markup Language
  • HTML is not a programming language, but a markup language
  • A markup language is a set of markup tags
  • HTML uses markup tags to describe web pages
  • HTML documents contain HTML tags and text content
  • HTML documents are also called web pages

HTML tags


HTML markup tags are often referred to as HTML tags ( HTML tag ).

  • HTML tags are  keywords surrounded by angle brackets  , such as<html>
  • HTML tags usually come in  pairs  , such as <b>and</b>
  • The first tag in the tag pair is the start tag and the second tag is the  end tag
  • Opening and closing tags are also known as opening  and  closing tags
    <tag>content</tag>
    

HTML element


"HTML tags" and "HTML elements" are often used to describe the same thing.

But strictly speaking, an HTML element contains a start tag and an end tag, as in the following example:

HTML element:

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

web browser


Web browsers such as Google Chrome, Internet Explorer, Firefox, and Safari are used to read HTML files and display them as web pages.

Web browsers do not display HTML tags directly, but use tags to decide how to present the content of an HTML page to the user.

HTML page structure


The following is a visual HTML page structure (only <body>the content of the tags will be displayed in the browser):

<html>
    <head>
        <title>page title</title></head>
    <body>
        
        <h1>this is a title</h1>
        <p>This is a paragraph.</p>
        <p>This is another paragraph.</p>

    </body>
</html>

HTML version


Since the birth of the original unstandardized Hypertext Markup Language, HTML has been updated in several versions:

release time Version
1989 Tim Berners-Lee Invents the World Wide Web
1991 Tim Berners-Lee develops the HTML specification
1993 Dave Raggett developed HTML+
1995 HTML Working Group defines HTML 2.0
1997 W3C Recommendation: HTML 3.2
1999 W3C Recommended Standard: html 4.01
2000 W3C Recommendation: XHTML 1.0
2008 WhatWG exposes HTML5 for the first time
2012 WHATWG develops HTML5 standard
2014 W3C Recommendation: HTML5
2016 W3C Candidate Recommendation: HTML 5.1
2017 W3C Recommendation: HTML5.1 Second Edition
2017 W3C Recommendation: HTML5.2

<!DOCTYPE> declaration


<!DOCTYPE>is a standard Universal Markup Language doctype declaration that helps display web pages correctly in browsers.

 Due to the different types of files on the web, the HTML version needs to be declared correctly so that browsers can correctly recognize and display your web page content.

doctypeDeclarations are case-insensitive and can be used in the following ways:

<!DOCTYPE html> <!DOCTYPE HTML> <!doctype html> <!Doctype Html>



General statement


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">