Webill
Webill

Reputation: 375

Is it correct to put a 'p' inside an 'a'?

I just watched this video about Bootstrap, and I saw a p inside an a. I would like to know if it is correct semantically.

Upvotes: 6

Views: 3999

Answers (1)

unor
unor

Reputation: 96587

This is allowed (since HTML5, where the a element has a transparent content model) if

  • the a element is valid at this position, and
  • the p element would be valid at a’s position, too.

(More detailed answer about the transparent content model)

Upvotes: 7

Related Questions