Written by
Robert Trew
Published on
17 January 2022
Share on:
The Lang attribute specifies the language of your website’s content using standardized language codes (e.g., en
for English, fr
for French). This attribute is added to the HTML <html>
tag and looks like this:
<html lang="en">
It tells browsers, assistive technologies, and search engines the primary language of the page, which influences how they interpret and interact with your content.
Assistive technologies like screen readers rely on the Lang attribute to correctly pronounce text. Without it, users with disabilities may encounter mispronunciations or difficulties understanding the content.
For example, a screen reader may struggle to pronounce "résumé" correctly without knowing the page is in English or French. Setting the Lang attribute resolves this, ensuring a seamless experience for users.
Search engines use the Lang attribute to better understand your content and match it with language-specific queries. For instance, if your page targets French-speaking users, setting the Lang attribute to fr
can help improve visibility in French-language search results.
If your site has multilingual content, correctly using the Lang attribute helps browsers switch between languages automatically. This creates a smoother experience for global audiences.
en
for English, es
for Spanish).<html>
tag of your website.en
for Englishfr
for Frenches
for SpanishThe Lang attribute is a small but powerful tool that enhances both the accessibility and discoverability of your Webflow site. By setting the Lang attribute in your site settings, you ensure your content is inclusive, user-friendly, and optimized for search engines.
Take a moment to configure this attribute today—it’s a simple step that delivers significant results for your audience and your site’s performance.
Without a Lang attribute, screen readers and browsers may misinterpret your content's language, leading to poor accessibility and a subpar user experience for language-specific users.
No, a single page should have only one primary Lang attribute. However, for multilingual content within a page, you can use the lang
attribute on specific elements to indicate different languages.
While not mandatory, setting the Lang attribute can significantly enhance SEO by helping search engines correctly index your site for language-specific searches, improving visibility in targeted regions.