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