Why is it important to declare the page language in HTML?
Declaring the page language in HTML matters because:
1. Search engines understand what language the content is in
This helps index the page correctly, show it to the right audience, and pick suitable snippets in search results.
<html lang="en">2. Screen readers and accessibility
Technologies for people with visual impairments use lang to read text with the correct pronunciation and accent. Without it, reading can be inaccurate.
3. Automatic translation
Browsers like Chrome rely on lang to offer a translation, or not offer one when the language already matches.
4. Multilingual sites
If a site has several languages, lang lets search engines and browsers precisely determine the language of each page or even of a single block of text (<p lang="en">...</p>).
This is a simple but important tag. Without it, a site can seem "unclear" to both search engines and users.
Short Answer
Interview readyA concise answer to help you respond confidently on this topic during an interview.