document.documentElement.lang = "xx"; in the Custom Code head section. To set the lang attribute of the HTML tag for a specific page in Webflow (e.g., for a multilingual site), you’ll need to use custom code since Webflow doesn’t allow direct editing of the HTML <html> tag in the Designer.
<head> Section
<head> tag field, paste the following small inline script:
<script>document.documentElement.lang = "es";</script>
"es" with the correct language code for the page (e.g., "fr" for French, "de" for German).
<html> tag and verify the lang="es" (or your chosen code) is applied.
To set the lang attribute dynamically for a specific page in Webflow, inject a small script like document.documentElement.lang = "xx"; in the page’s custom code section. This method allows per-page language settings without needing full code export.