1. What is HTML?
HTML is called Hypertext Markup Language and is a markup language. It includes a series of tags. These tags can unify the document format on the network and connect scattered Internet resources into a logical whole. HTML text is descriptive text composed of HTML commands. HTML commands can describe text, graphics, animations, sounds, tables, links, etc.
Hypertext is a way of organizing information that associates text, graphics, and other information media through hyperlinks. These interrelated information media may be in the same text, may be other files, or may be files on a computer that are geographically distant. This way of organizing information connects information resources distributed in different locations in a random manner, making it easier for people to find and retrieve information.
● Brief description
HTML is the abbreviation of HyperText Mark-up Language, which means hypertext mark-up language;
HTML is not a programming language, but a markup language;
Hypertext refers to hyperlinks, and markup refers to tags. It is a language used to create web pages. This language is composed of tags one by one;
Files made in this language are saved as text files, with the file extension being .html or .htm;
An html document is also called a Web page. It is actually a web page. When an html file is opened with an editor, it displays text. You can edit it using text.
If you open it with a browser, the browser will render the file into a web page according to the tag description content. The displayed web page can jump from one web page link to another web page.
●Let’s analyze its essence from the full Chinese name of HTML:
(1) Hypertext
That is, beyond plain text, this means that HTML documents can not only contain text (text), but also include advanced content such as images, audio and video, tables, lists, links, buttons, input boxes, etc.
Hyperlink is the link of the Internet. It can connect many web pages and intertwine them to form a "net". Without hyperlinks, there would be no Internet.
(2) Markup language
HTML is a computer language, but it cannot be programmed and can only be used to mark up content on web pages. HTML uses different tags to mark different content, formats, layouts, etc., such as:
The <img> tag represents an image;
The <a> tag represents a link;
The <table> tag represents a table;
The <input> tag represents an input box;
The <p> tag represents a piece of text;
The <strong> tag represents the text bolding effect;
The <div> tag represents block-level layout.
Summarize
HTML is a computer language used to develop web pages. It displays text, audio and video, pictures, tables, buttons, input boxes and other content through tags (marked instructions). In other words, HTML is used to format and layout web content.
2. HTML version development history:
Since the birth of HTML, after continuous development, many HTML versions have appeared on the market. A brief introduction to HTML versions is as follows:
3. HTML content
●HTML tags
As mentioned above, HTML is a markup language that uses various tags to format content. The characteristics of tags are as follows:
(1) HTML tags consist of keywords surrounded by angle brackets, such as <html>;
(2) Except for a few tags, most HTML tags appear in pairs, such as <b> and </b>;
(3) Among tags that appear in pairs, the first tag is called the start tag, and the second tag is called the end tag (closing tag).
Different tags in HTML have different meanings. Learning HTML actually means learning the meaning of each tag, and selecting appropriate tags according to the needs of the actual scenario, so as to create beautiful web pages.
●HTML document structure
The basic structure of an HTML page is as follows, which contains various tags required to create a web page (such as doctype, html, head, title, body, etc.).
<!DOCTYPEhtml><html><head><metacharset=UTF-8><title>HTML document structure example</title></head><body><h1>This position is a title</h1><p> This position is a paragraph</p><p>This position is another paragraph</p><ahref=http://c.biancheng.net/target=_blank>This position is a link pointing to the homepage of the C Language Network </a><ul><li>HTML tutorial</li><li>CSS tutorial</li></ul><inputtype=textplaceholder=text content/></body></html>
The syntax is explained as follows:
<!DOCTYPE html>: This is a document type declaration, used to declare the document as an HTML document (technically it is not a tag), the doctype declaration is not case-sensitive;
<html> </html>: This tag is the root tag of the HTML page. All other tags need to be defined between the <html> and </html> tags;
<head> </head>: This tag is used to define some information of the HTML document, such as title, encoding format, etc.;
<meta charset=UTF-8>: Used to indicate that the current web page uses UTF-8 encoding. UTF-8 is a globally accepted encoding format, and most web pages use UTF-8 encoding;
<title> </title>: This tag is used to define the title of the web page. The title of the web page will be displayed in the browser's tab bar;
<body> </body>: This tag is used to define all the content in the web page that we can see through the browser, such as paragraphs, titles, pictures, links, etc.;
<h1> </h1>: This tag is used to define the title;
<p> </p>: This tag is used to define a paragraph;
<a> </a>: This tag is used to define links;
<ul> </ul>: This tag is used to define a list;
<li> </li>: This tag is used to define list items;
<input type=text />: used to define an input box.
Since HTML documents are text files, we can use any text editor to create and modify HTML files. For beginners, it is best to use the text editor that comes with the system, such as Windows Notepad, Linux Vim and Mac OS TextEdit. After you have a certain foundation, you can then choose a professional text editor, such as Notepad++, Sublime Text, VS Code, etc.
In addition, you must save the HTML document in .html or .htm format before you can open it directly in the browser and browse the content. For example, save the above sample code in a file named index.html. Double-click it to see the running results in the browser, as shown in the following figure:
●Characteristics of HTML
(1) Simplicity: The hypertext markup language version upgrade adopts a superset method, making it more flexible and convenient.
(2) Scalability: The wide application of hypertext markup language has brought about requirements for enhanced functions and added identifiers. Hypertext markup language adopts the method of subclass elements to ensure system expansion.
(3) Platform independence: Although personal computers are popular, there are many people using other machines such as MAC. Hypertext Markup Language can be used on a wide range of platforms, which is another reason for the popularity of the World Wide Web (WWW).
(4) Universality: In addition, HTML is the universal language of the Internet, a simple and universal all-in-one markup language. It allows web page producers to create complex pages that combine text and images, and these pages can be viewed by anyone else on the Internet, regardless of the type of computer or browser used.