<?xml version="1.0" encoding="utf-8"?>

Set the page's language in the <html> tag

Set the page's language in the <html> tag

To set the page's default language, use the lang attribute inside the <html> tag. If you use the lang attribute in the <body> tag, it won't cover the head element's content of the document.

It is also possible to set languages for different parts of the content. For example, if you have a paragraph in Japanese, use the attribute lang in that paragraph's tag, so the browser displays it correctly.

Improve your UX & Product skills with interactive courses that actually work