HTML document b...LOGIN

HTML document basic format

1. What is html?

html is a hypertext markup language and is currently the most widely used language on the Internet. It HTML tags are mainly used to describe text, pictures, sounds and other content in web pages, which is the basis of web documents.


2, html The basic format of the document

#To learn any language, you must first master its basic format, and HTML markup language is no exception. In order to create colorful HTML web pages, you first need to master the basic format of HTML documents.

This case enables beginners to better understand the basic format of HTML documents by writing a simple HTML web page.

We right-click to create a new html file in our editor

微信图片_20180314100113.png

Name it demo1.html

We can see this page in the editor (using PhpStorm here):

微信图片_20180314100245.png

<!DOCTYPE> tag:

##<!DOCTYPE> tag is located at the front of the document and is used to indicate to the browser what kind of HTML the current document uses. Or XHTML standard specification. For example, [demo1] uses standard html format documents.

Use the <!DOCTYPE> tag at the beginning to specify the HTML version and type for all HTML documents. Only in this way can the browser parse the web page as the specified document type.

##<html></html> Tag: ##<html>The tag is located at <! After the DOCTYPE> tag, also called the root tag, it is used to tell the browser that it is an HTML document. The <html> tag marks the beginning of the HTML document, and the </html> tag marks the end of the HTML document. In between is the document's header and body content.

<head></head>Tag:

The<head> tag is used to define the header information of the HTML document, also called the head tag. It follows the <html> tag and is mainly used to encapsulate other tags located at the head of the document. For example, <title>, <meta>, <link>, and <style> are used to describe the document's title, author, and relationship with other documents.

An HTML document can only contain a pair of <head> tags. The data contained in the header of most documents will not actually be displayed as content on the page.

##<meta></meta> Tag:

##The META tag is one of the HTML tag HEAD areas Key tag, which is located between <head> and <title> in the HTML document (some are not between <head> and <title>). The information it provides, although not visible to the user, is the most basic meta-information of the document. <meta> In addition to providing basic information such as document character set (such as the UTF-8 encoding format in this example), language used, author, etc., it also involves setting keywords and web page levels.

##<title></title> Tags:

## can display the text you need on the column, such as

<title>PHP Chinese website</title>

微信图片_20180314101534.png#<body></body> Tag:

##<body> tag It is used to define the content to be displayed in the HTML document, also called the body tag. All text, images, audio, video and other information displayed in the browser must be located within the <body> tag. The information in the <body> tag is what is ultimately displayed to the user.

An HTML document can only contain a pair of <body> tags, and the <body> tag must be within the <html> tag, located after the <head> header tag , which is in parallel relationship with the <head> tag.

Next Section

<?php echo "HTML的基本格式";
submitReset Code
ChapterCourseware