What is html? A complete html code tells you (complete example version)

寻∝梦
Release: 2018-08-27 13:53:45
Original
15015 people have browsed it

htmlWhat does it mean? This article mainly explains the basic complete code of HTML document for everyone, as well as specific example explanations, so that everyone can understand the basic structure and usage of HTML at a glance. Let’s take a look together

What is .html?

In terms of language, HTML is a hypertext markup language, a language used to display web pages, and is specially written for browsers to read. It can contain many things, such as a picture, a link, music, or non-text elements such as small applications. The HTML language includes the head of the web page (in the head tag) and the main part of the web page (in the body tag). All the content of the main body will be displayed on the browser page. The content of the header is mainly to assist the browser in displaying the content of the main part, and both are important. (Related tutorials recommended: HTML Development Manual)

2. The following shows you the complete code of the basics of HTML

<!doctype html>(给浏览器看的,向浏览器说明是html文档)
<html>(html文档的开头,还有最后一行是HTML文档的结尾)
<head>(头部的开始,里面有时候要放不少东西,辅助主体文档的正常显示的)
<meta charset="utf-8">(这行是头部里面的meta标签的第一行内容,是告诉浏览器这文档是属于utf-8字符编码格式的还有不少比较常见的,这里就不多介绍了)
<title>PHP中文网</title>(title标签,是属于头部里面的定义标题的标签,会显示在浏览器的页面上方的标签页上面的)
</head>(头部结束)
<body>(主体开始,主要把文档的所有内容都放到网页中)
	hello world开始时随便加的一句问候)
</body>(主体结束)
</html>(文档结束)
Copy after login

The above is one All the code in the document will look like this after running:

What is html? A complete html code tells you (complete example version)

What is on the tab page above is the content displayed in the title, and what is in the body is displayed on the web page .

In this way, a complete html code has been explained (relevant video course recommendation: Building an HTML page from scratch), but we need to continue to consolidate it. Let’s explain all the common codes mentioned above:

3. The explanations of codes and tags involved above

are from the documentation An important tag that must be written at the beginning and end

The head tag is also a double tag. It must have an end to assist in displaying the

of the main body of the page. is the tag of the title. The one on the PHP Chinese website in the picture above is written here. , contains a lot of tags, I will introduce them to you one by one later

Several new tags of the four.html code

The above are the basic tags on the web page , let me show you a code that adds something and recognizes a few new tags:

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>PHP中文网</title>
</head>
<body>
	<h1>hello world</h1>
	<h2>这是主体中的标题标签</h2>
	<h3>比正常显示的文字要大<h3>
	<p>正常文字</p>
	<p>这是写段落的,可以写很多字的。。。。。。。。。。。。。。。。。。。很多字。。。。。。。。。。。。。。。。。很多字。。。。。。。。。。。很多字的</p>
	<p>这也是写段落的,可以写很多字的。。。。。。。。。。。。。。。。。。。很多字的</br>这是换行显示。。。。。。。。。。。。。。。。。很多字。。。。。。。。。。。很多字的</p>
</body>
</html>
Copy after login

Do you understand the above code? Let me show you the

effect after

is run:

This comparison should be very clear. The title tags in the main body are all enlarged. It is represented by

or

, which is a bit larger than the normal text. This is also a commonly used tag. There is also a

tag, which is used to represent a paragraph. Of course, lines can be wrapped in a paragraph. For example, I added a (a single tag in HTML) tags, and then separated within the body of the web page.

What is html? A complete html code tells you (complete example version)Okay, this is the normal display text of the HTML document. The complete code is here. Take a look for yourselves. If you have any questions, please ask below.

[Editor’s related articles]

What does the head tag in HTML mean? An article teaches you how to use the head tag correctly


Should hackers learn PHP or python? Rational analysis of ten differences between PHP and python

The above is the detailed content of What is html? A complete html code tells you (complete example version). For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template