GEspinha GEspinha - 14 days ago 7
CSS Question

Allowed children for an <a> element?

I have been working with a lot of

html
structuring lately and I started to wonder what are the elements that are allowed as children of an
<a>
element?

Answer

Changes in HTML5

Although previous versions of HTML restricted the a element to only containing phrasing content (essentially, what was in previous versions referred to as “inline” content), the a element is now transparent; that is, an instance of the a element is now allowed to also contain flow content (essentially, what was in previous versions referred to as “block” content)—if the parent element of that instance of the a element is an element that is allowed to contain flow content.

HTML language reference

Comments