link nested within elements
Classified as: metadata content, flow content, phrasing content
Parents, link
Children, link
The link element requires:
- either rel attribute (when nested inside head): < rel="keyword" ... >
- either itemprop attribute (when nested inside head, body): < itemprop="property" ... >
Examples: link parents
1 2 3 4 5 6 7 8 9 10 | <!doctype html> <> <> <>... <⁄> < rel="keyword"> <⁄> <> <⁄> <⁄> |
1 2 3 4 5 6 7 8 9 10 11 | <!doctype html> <> <> <>... <⁄> <⁄> < itemscop itemtype="url"> < itemprop="property"> <⁄> <⁄> |
1 2 3 4 5 6 7 8 9 10 11 12 | <!doctype html> <> <> <>... <⁄> < rel="keyword"> <⁄> < itemscop itemtype="url"> < itemprop="property"> <⁄> <⁄> |
Syntax 1: Valid → link element is present in head section
Syntax 2: Valid → link element is present in body section
Syntax 3: Valid → link element is present both in head and body sections
Video demonstration nesting link
HTML5 nesting link, Tutorial
min | video details |
---|---|
00:13 | the video tutorial presents the link element placed both in head and body sections |
00:22 | while rel attribute can be used only in head section |
00:28 | itemprop attribute can be used in both: head, body |
00:35 | link in head |
00:35 | adding the link element in head section: <link rel> |
00:53 | rel allows us to specify the relationship between the linked resource and the current page: example |
00:43 | link in head and body |
00:43 | adding link element in both sections: <link itemprop> |
01:31 | itemprop allows us to add a property for an item |
01:36 | concrete example of a link element in body section, itemprop attribute |