How to use an tag inside a in the middle of a text? [duplicate]

It is not valid to have a h2 inside of a p.

Aside from that, and to answer your question, a h2 is a block level element. Making it an inline level element will cause it to behave similarly to how you describe the b tag acting.

p h2{display:inline}

As I said above though, the HTML you’ve given is invalid.

Leave a Comment