2nd Chapter Basic Format

Source: Internet
Author: User
Tags sublime text

Learning Essentials:

1.HTML5 Document Structure
2. Document Structure resolution
3. Element tag Discussion

Keynote Teacher: Li Tinghui

This chapter mainly starts with the document structure of HTML5. These base elements determine the outline of the HTML document and the initial environment of the browser. Almost all pages must first type these elements.

A HTML5 Document Structure
1. First step: Open Sublime Text 3, open the specified folder;
2. Step two: Save the index.html file to disk,. html is the page suffix;
3. Step three: Start writing the basic format of the HTML5.

<!DOCTYPE HTML>//Document type declaration<HTMLLang= "ZH-CN">//Indicates the beginning of the HTML document<Head>//contains document Meta data start<MetaCharSet= "Utf-8">//Declaration character encoding<title>Basic structure</title>//Set document title</Head>//contains document meta-data end<Body>//Represents HTML document content<ahref= "Http://www.baidu.com">Baidu</a>//A hyperlink Element (label)</Body>//Represents HTML</HTML>Represents the end of an HTML document

Two Document Structure resolution
1.Doctype
Document type declaration (Doc type Declaration, also known as Doctype). It mainly tells the browser what type of file you are viewing. In previous HTML4.01 and XHTML1.0, it represents the specific HTML version and style. And now HTML5 don't need to show the version and style.

<! DOCTYPE HTML >        Not partition case

2.html elements
First, the element is the meaning of the tag, and the HTML element is the HTML tag. HTML elements are the beginning and ending elements of a document. It is a double-label, tail-to-echo, containing content. This element has an attribute and value: lang= "ZH-CN", which indicates that the document is in the language: Simplified Chinese.

<lang= "ZH-CN">   //If English is en

3.head elements
Used to contain metadata content, including:<link>, <meta>, <noscript>, <script>, <style>, <title>. This content is used by the browser to provide information, such as link to provide CSS information, script to provide JavaScript information, Title provides page title and so on.

< Head >... </ Head >      This information is not visible on the page

4.meta elements
This element is used to provide information about the document, with a property of the starting structure: charset= "UTF8". Tells the browser page what encoding to use, in general we use UTF8. Of course, when the file is saved is also UTF8, and the browser settings UTF8 can display Chinese correctly.

<charset= "Utf-8">    //In addition to setting the encoding, there are other

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

< title > Basic structure </title>

6.body elements
The element used to contain the contents of the document, which is the part of the browser visible area. All visible content should be added inside this element.

< Body >... </ Body >

7.A elements
A hyperlink, which is discussed in more detail later.

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

Three Discussion on element tags
HTML is a markup language, the structure we have just discussed in detail. Here, let's dissect these "tags" or "tags", which are often called "elements" in writing.

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 and will be followed by paragraph labels, text labels, link labels, picture tags, and so on.
Elements are generally divided into two categories: single label (empty Element) and double label. Single-label is generally used to declare or insert an element, such as the declaration of character encoding with <meta>, insert a picture with ; double-label is used to set up a section of the content, include it, such as paragraph <p>...</p>.

2. Properties and Values
Elements can also be set to 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>, in which a replacement URL can be linked to a different website. Of course, you can set multiple attributes within an element, even custom properties.

2nd Chapter 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.