Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

HTML HTML Lists Definition Lists

Question: when we use the attribute "lang" will it change the language of the text (Example Is Below).

EX. <p lang="fr">Hello World</p>

1 Answer

Steven Parker
Steven Parker
231,236 Points

The "lang" attribute is used to identify what language the content is in, it does not cause any action to occur. It might be used in a search to return only pages using a specified language.

The example shown above is not a valid use of the attribute! Here it as again along with a proper one:

<p lang="fr">Hello World</p>       <!-- IMPROPER use of attribute (language mismatch) -->

<p lang="fr">Bonjour le Monde</p>  <!-- correct use of attribute -->

Thank you , Steven

Steven Parker
Steven Parker
231,236 Points

Glad to help. And happy coding!

Thank you again, Steven.