a nested within elements, elements nested within a
Classified as: flow content, phrasing content, interactive content, palpable content
Parents, a
Children, a
- transparent content model:
- a content model = transparent → a element accepts the elements its parent accepts, except for elements listed as interactive content
- (the elements, possible parents of the a element, are listed above)
e.g.
1: abbr element, parent of the a element
<abbr> <a>... <⁄a><⁄abbr>
2: abbr element accepts the b element as child
<abbr> <b> ... <b⁄><⁄abbr>
Conclusion: if the abbr element accepts the b element as child, then the a element will accept it too
<abbr> <a> <b> ... <b⁄> <⁄a><⁄abbr>
Examples: a parents, a children
1 2 3 4 5 6 7 8 9 10 11 | <!doctype html> <> <> <>...<⁄> <⁄> <> <⁄> <⁄> |
1 2 3 4 5 6 7 8 9 10 11 | <!doctype html> <> <> <>...<⁄> <⁄> <> <><>...<⁄><⁄> <⁄> <⁄> |
1 2 3 4 5 6 7 8 9 10 11 12 | <!doctype html> <> <> <>...<⁄> <>...<⁄> <⁄> <> <⁄> <⁄> |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | <!doctype html> <> <> <>...<⁄> <⁄> <> <> <>...<⁄> <⁄> <⁄> <⁄> |
Syntax 1: Valid, a element absent; a element is optional
Syntax 2: Valid, one or multiple a elements are allowed per HTML5 document; a element can be nested within the p element
Syntax 3: Invalid, a element cannot be nested inside the head element
Syntax 4: Invalid, interactive content (a element) cannot be nested inside a element