📜  html lang en-us 或 en-US - Html (1)

📅  最后修改于: 2023-12-03 15:15:34.227000             🧑  作者: Mango

HTML lang en-us/en-US

HTML lang attribute is used to define the language of the document.

What does en-us or en-US mean?

en-us or en-US are language codes that represent the language and country of the English language used in the United States. The en stands for English and the us or US stands for United States.

en-us and en-US are the same language code. However, en-us is in lowercase and en-US is in uppercase. Both are commonly used and recognized.

How to use lang attribute in HTML?

The lang attribute is used in the html tag to specify the language of the document. Here is an example:

<!DOCTYPE html>
<html lang="en-us">
<head>
    <meta charset="UTF-8">
    <title>My Webpage</title>
</head>
<body>
    <h1>Welcome to My Webpage</h1>
    <p>This is a paragraph of text.</p>
</body>
</html>

In the above example, the html tag has lang attribute set to en-us which means that the document is in the English language used in the United States.

Importance of using lang attribute

The lang attribute is important for accessibility and search engine optimization. It helps screen readers to read the text in the correct language and also helps search engines to understand the content of the webpage.

Conclusion

In conclusion, html lang en-us/en-US is an important attribute used to specify the language of the document. It is important to use the lang attribute for accessibility and search engine optimization.