HTML Questions & Answers Logo
HTML Questions & Answers Part of the Q&A Network
Q&A Logo

How can I specify language for accessibility in HTML?

Asked on Sep 26, 2025

Answer

To specify the language for accessibility in HTML, use the lang attribute within the <html> tag. This helps screen readers and other assistive technologies determine the correct pronunciation and language rules.
<!-- BEGIN COPY / PASTE -->
    <html lang="en">
      <head>
        <title>Accessible Page</title>
      </head>
      <body>
        <p>Hello, world!</p>
      </body>
    </html>
    <!-- END COPY / PASTE -->
Additional Comment:
  • The lang attribute should be placed in the <html> tag to apply to the entire document.
  • Use language codes like "en" for English, "es" for Spanish, or "fr" for French.
  • Specifying the language improves the accessibility and SEO of your webpage.

✅ Answered with HTML best practices.


← Back to All Questions
The Q&A Network