Ticket #TKMA

Why is the <p> tag around the <img> tag?

I have it:

<p>
    <img src="media/icons/info_ticket.png"></img>
    <h3>Ticket #TKMA<span><?php echo $_GET['CRy3sjzZOJyXE']; ?></span></h3>
</p>

And when I use CSS to change the style img, it doesn't work! So, I inspected the item and I found this:

<p>
    <img src="media/icons/info_ticket.png">
</p>
<h3>Ticket #TKMA<span>17</span></h3>
<p></p>

I do not understand why this is happening.

+5
source share
4 answers

The reason is that the element Hinside the element is <p>invalid, so the browser fixes it by pulling it out.

+3
source

<h3> a <p> html

.

+2

The tag is <h3>not valid inside the tag <p>. Your editor “corrects” it by moving the heading outside the paragraph, leaving only the image in the paragraph.

+2
source

All Articles