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
Jeff Campbell
2,365 PointsHTML element attributes double language ?
If I'm creating a website that incorporates 2 languages,one that uses extra characters, do I need to list both in the html attribute- lang? How would that look?
3 Answers
Tim Knight
28,888 PointsHi Jeff,
There is no mention in the specification about using a list of language strings for that attribute and every example I've seen uses only a single language setting. This makes sense of course since a piece of content itself can only be in one language at a time. If you're wanting to support multiple languages of content on the same page you could set your default language from within your HTML tag
<html lang="en">
And then within the content you could set a section of the page with a different language attribute
<span lang="fr">...</span>
Any specific elements with language attributes would override the global <html> lang attribute.
Jeff Campbell
2,365 PointsHey Tim,
Thanks for the response and clarification. Using the span tags certainly makes sense now as I didn't catch it when I read it on W3C site. Thanks again mate!!!
Tim Knight
28,888 PointsNo worries Jeff, any containing tag will work for the lang attribute, <div> too.