w3-video.com logo

HTML5 Tutorial

Home HTML5 XAMPP .htaccess Firefox Notepad++

Share it



a hreflang attribute

The hreflang attribute on the a element:


Warning: hreflang attribute can be used only if href attribute is present on a element.

Examples

<aattribute="value(s)">...<⁄a>example
3.hreflang=language code<a href="file.php" hreflang="en"> ... <⁄a>

Video demonstration a hreflang attribute

HTML5 a hreflang attribute Tutorial

min video details
00:08 video tutorial: a element, hreflang attribute
objective: understanding hreflang attribute
00:16 the hreflang attribute:
- is optional
- can be used only if href attribute is present
- allows you to specify the language (code) of the linked resource
00:23 the href attribute is present on a element → we can add the hreflang attribute too
00:29 the language of the content_editable.php (the linked resource) is English ; the corresponding language code is: en
00:36 note: the content of the page is in English language
00:44 adding the language of the linked resource to the a element through hreflang attribute
00:53 if your linked resource is in other language, search for its corresponding code and add it as value of the hreflang attribute
a intro a browser display a parents - childrena content model: transparenta warninga syntaxa download attributea href attributea rel attributea target attributea type attributea itemprop attribute