lang属性指定用于编写网页内容的语言。它用于设置网页整个文本的语言。
和的区别如下:
仅指定页面的语言代码,意思是页面上的所有文本都使用 en 或英语。
例子:
lang Attribute
GeeksforGeeks
jQuery is an open source JavaScript library that
simplifies the interactions between an HTML/CSS document,
or more precisely the Document Object Model (DOM), and JavaScript.
Elaborating the terms, jQuery simplifies HTML document
traversing and manipulation, browser event handling,
DOM animations, Ajax interactions, and cross-browser
JavaScript development.
输出:
指定页面的语言代码,后跟国家代码,这意味着页面上的所有文本都使用美国风格的英语。
which means the United Kingdom style of English
which means the Indian style of English
例子:
lang Attribute
GeeksforGeeks
jQuery is an open source JavaScript library that
simplifies the interactions between an HTML/CSS document,
or more precisely the Document Object Model (DOM), and JavaScript.
Elaborating the terms, jQuery simplifies HTML document
traversing and manipulation, browser event handling,
DOM animations, Ajax interactions, and cross-browser
JavaScript development.
输出: