Html5 Study Notes-

Source: Internet
Author: User
If the browser complies with w3c standards, the lang attribute can be used to define the style. The class defines the main style, and the lang attribute can be modified on this basis .,. Html5 documents must start


Lang is an attribute, and the attribute value is en (the definition language is English) or zh-CN (the definition language is Chinese)


If the browser complies with w3c standards, the lang attribute can be used to define styles. The class defines the main styles, and the lang attribute can be modified on this basis,




For example:


Here, the main css of the p tag only defines the font size and color, and then the font needs to be determined through the lang attribute of the tag.

The benefit of the lang attribute lies in its CSS inheritance. Maybe the p tag needs to define many styles, but different languages (not just languages) may need to change a small amount of styles, if these styles are defined separately, CSS may be very lengthy, wasting user traffic and memory.

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.