Chapter 2 Global attributes and others-original of water

Source: Internet
Author: User
Chapter 2 Global attributes and other-original learning points of water:

1. Entity

2. Metadata

3. Global attributes

Lecturer: Li Yanhui

This chapter mainly discusses HTML entities in HTML5 and the metadata of HTML core components. Finally, we will take a look at the global attributes in HTML.

I. Entity

HTML entities display special characters in Entity code.

Ii. Metadata

Elements can define various metadata in the document, and an HTML page can contain multiple Element.

1.Name/Value metadata pair

 
  

Metadata name

Description

Author

Author of the current page

Description

Description of the current page

Keywords

Keyword of the current page

Generator

Encoding tool for the current page

2. Declare character encoding

 

3. Simulate the HTTP header field

// Jump to the specified URL in 5 seconds

 

// Another type of declarative character encoding

 

Attribute Value

Description

Refresh

Reload the current page or specify a URL. Unit: seconds.

Content-type

Another way to declare character encoding

Iii. Global attributes

Before that, we have explained all the elements involved in its local data. Of course, we also know some global attributes, such as id. Global attributes are common actions of all elements. HTML5 also provides some other global attributes.

1. idAttribute

Section

Explanation: The id attribute assigns a unique identifier to the element. This identifier is usually used to select elements for CSS and JavaScript calls. Only one id can appear at a time on a page.

2. classAttribute

Section


Section


Section

Explanation: The class attribute is used to classify elements. You can set CSS styles at the same time by setting one or more elements in the document.

3. accesskeyAttribute

 

Explanation: shortcut key operation. In windows, alt + specifies the key, provided that the alt of the browser does not conflict.

4. contenteditableAttribute

Can I modify it?

Explanation: make the text editable. If it is set to true, the text can be edited. If it is set to false, the text cannot be edited. Or directly set properties.

5. dirAttribute

Text to the right

Explanation: Let the text be left-to-right (ltr) or right-to-left (rtl ).

6. hiddenAttribute

Text to the right

Explanation: Hide elements.

7. langAttribute

HTML5

Explanation: You can set the language locally.

8. titleAttribute

HTML5

Explanation: Add a prompt to the content of the element.

9. tabindexAttribute

 

Explanation: press the tab key in the form to obtain the focus sequence. If it is-1, it will not be selected.

10. styleAttribute

CSS style

Description: sets the CSS style in the element row.

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.