Can I specify the language of specific parts of my page?

Question

As an example, let's suppose I want to write the following. 'The french word bonjour means hello in english.' My sites language is english, but I would like screen readers to know that 'bonjour' is written in french. Is that something I should even bother with?

Answer

Yes, you can, and yes you should! The same way you specific the language of the document in the HTML tag with lang="en" you can specify the language of individual elements the same way! Consider your example:

<p>The french word <span lang="fr">bonjour</span> means hello in english.</p>

Free Tools to Continue Learning

Accessible Web Company Logo

Accessible Web RAMP

Monitor your website and manage your progress towards WCAG conformance.

Accessible Web Company Logo

Accessible Web Academy

Career specific courses to help power up your accessibility knowledge.