w3-video.com logo

HTML5 Tutorial

Home HTML5 XAMPP .htaccess Firefox Notepad++

Share it



html lang attribute

The lang attribute on the html element:

Examples

<htmlattribute="value(s)">...<⁄html>example
16.lang=language code<html lang="en"> ... <⁄html>
<html lang="fr"> ... <⁄html>

Video demonstration html lang attribute

HTML5 html lang attribute Tutorial

min video details
00:02 launch lang.php file in browser
00:04 open lang.php file in Notepad++
00:08 the content of the page is in English, the language code is "en"
00:12 the value of the lang attribute is: language code (e.g. "en" or "fr" or..)
00:12 adding the lang attribute, value:"en" to the html tag
00:17 saving the modifications in Notepad++ and refreshing the file in browser
00:19 testing: <html lang="en">
00:20 result: nothing happens; it is normal; specifying the language of the document is useful for user agents
00:23 if the content of your page is in French you will add the "fr" language code as value of the lang attribute applied on the html tag
html intro html optional html occurrences html browser display html children html syntaxhtml manifest attribute introappcache CACHE sectionappcache NETWORK sectionappcache FALLBACK sectionappcache ADVANTAGESappcache DISADVANTAGEappcache fixes: 1aappcache fixes: 1bappcache fixes: 2aappcache fixes: 2bappcache fixes: 2cappcache fixes: 3html class attributehtml contenteditable attributehtml contextmenu attributehtml dir attributehtml hidden attributehtml id attributehtml spellcheck attributehtml style attributehtml title attributehtml translate attribute