HTML Document BASIC format

Source: Internet
Author: User

first, the basic format of HTML document :

<! DOCTYPE html>//Document type declaration 


Second, the document structure analysis:

1, Doctype

The document type declaration (documents type Declaration, also known as DOCTYPE), which mainly tells the browser what type of document to view.

<! DOCTYPE html> Case insensitive

2. HTML elements

First, the element is the meaning of the tag, and the HTML element is the HTML tag. The HTML element is the element at the beginning of the document and at the end of the document. It is a two-to-one double tag, and the HTML element has an attribute and value

Lang= ' ZH-CN ', which means the document language is Simplified Chinese


3. Head element

Used to contain metadata content, including:<link>, <meta>, <moscript>, <script>, <style>, <title>. This content is used by the browser to provide information, such as link to provide CSS information. Script provides javascript information, Title provides page titles, and so on.


4. Meta elements

This element is used to provide information about the document, in fact the structure has a property: charset= ' UTF8 '. Represents the encoding that tells the browser page what format to use. In general, use UTF8. Of course, the file is saved is also UTF8, and the browser also set UTF8 can display Chinese correctly.

<meta charset= ' Utf-8 ' >


5. Title Element

This element is simple, as the name implies: Set the title of the upper left corner of the browser

<title> title </title>


6. BODY Element

The element used to contain the contents of the document, which is the part of the browser visible area. All the visible content should be added here.

<body>...</body>


7, a element

A hyperlink, which is discussed in more detail later.

<a href= ' http://www.baidu.com ' > Baidu </a>


Three, Yuan Vegetarian Label discussion:

HTML is a markup language, the structure we have discussed in detail, here, we will analyze the following "tags", or how the label is composed.


1. Elements

An element is a set of tags that tell the browser how to handle some content. Each element has a keyword, such as:<body>, <title>, <meta> are elements. Different label names represent different meanings. The following will involve paragraph tags, text tags, link labels, picture labels, and so on.

Elements

Generally there are two kinds: single label (empty Element) and double label. However, labels are often used to declare or insert an element. For example, the declaration of character encoding with <META> Insert picture with <imag>, double labels are typically used to set the contents of an area and include them. such as paragraph:

<p>...</p>


2. Attributes and Values

Elements can also set properties and values in addition to a single-pair element. These attribute values are used to alter the behavior of certain aspects of an element. For example, the href attribute in hyperlink:<a>. You can link to a different Web site by replacing the URL. Of course an element may set multiple properties, even custom attributes.



This article is from the "Zengestudy" blog, make sure to keep this source http://zengestudy.blog.51cto.com/1702365/1896988

HTML Document BASIC format

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.