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>
1.4m articles
1.4m replys
5 comments
57.0k users