Chapter 4 basic format-original learning points of water:
1. HTML5 document structure
2. Document Structure Analysis
3. Element tags
Lecturer: Li Yanhui
This chapter focuses on the structure of HTML5 documents. These basic elements determine the outline of the HTML document and the initial environment of the browser. Almost all pages must first type these elements.
I. HTML5 document structure
1. Step 1: Open Sublime Text 3 and open the specified folder;
2. Step 2: Save the index.html file to the suffix of the webpage;
3. Step 3: Write the basic HTML5 format.
// Document type declaration// Indicates that the HTML document starts.// Start with containing the document metadata
// Declare the character encodingBasic Structure// Set the document title// The metadata of the included document ends.// Indicates the HTML document content Baidu // a hyperlink element (TAG)// HTML// Indicates that the HTML document has ended.
Ii. Document Structure Analysis
1. Doctype
Document Type Declaration (Doctype ). It mainly tells the browser the type of the file to be viewed. In the past HTML4.01 and XHTML1.0, it represents the specific HTML Version and style. Currently, HTML5 does not need to express versions and styles.
// Case insensitive
2. html elements
First, the element is the meaning of the tag, and the html element is the html Tag. Html elements are the elements at the beginning and end of a document. It is a dual-label that echoes the head and tail and contains the content. This element has an attribute and value: lang = "zh-cn", indicating that the document uses the simplified Chinese language.
// In English, the value is en.
3. head Element
Used to include metadata content. Metadata includes: , , , Script,