- Courses
- HTML
- HTML top level tags
- <html>
- Effects of missing lang in <html>
What happens if the lang
attribute is not specified in the <html>
element?
Screen readers may default to the operating system's set language, potentially causing mispronunciations.
Including a lang
attribute ensures that the language used for the page content is properly identified, helping screen readers announce the content correctly and enhancing the page's accessibility. Without it, users relying on assistive technologies might experience incorrect pronunciations or misunderstandings of the content.
<html lang="en">
<head>
<title>Example Page</title>
</head>
<body>
<p>Hello, world!</p>
</body>
</html>