Here is my code:
<html> <head> <style> div p h1 { background-color: red; } </style> </head> <body> <div> <p><h1>hello2</h1></p> </div> </body> </html>
I think thats why:
The <p> tag can only contain inline elements. The header tags are block-level elements, and cannot go inside <p> tags even when you style them to display inline.
<p>
2.1m questions
2.1m answers
60 comments
57.0k users