The function of the lang attribute of HTML

Source: Internet
Author: User

Today, the CSS authoritative guide selector chapter, see Pseudo-class selector, also called language selector: lang (language), as the name implies it will be based on the HTML settings of the language to apply the corresponding style, such as:

*:lang (en) {    color: red;}

is going to work on this P element.

<lang= "en"> Chinese</p  >

The effect is that the text in P is all shown in red, en for English, but this style will be applied regardless of whether the text in the P element is Chinese or French.

The lang attribute optional value is shown here.

What is the use of setting the lang attribute?

    • Depending on the lang attribute to set CSS styles for different languages, or font

    • Tell the search engine to do accurate identification

    • Let the grammar checker do language recognition

    • Help the translation tool to do the identification

    • Help the Web reader to do the identification and so on

The above points are the answers that feel more reliable. Welcome to discuss

The function of the lang attribute of HTML

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.