<img> is inline-block elements( or likely)
when i add a <p> with "display:inline;" the paragraph and the image are on the same line( like below)
but when I use another <p> with "display:inline;" as a container for the earlier <p>, the paragraph act like a block element and push the <img> down although both the container and the child were inline.
Anyone knows why ?
this is my line of codes( it is just a test code so it doesn't have any use)
<p style="display:inline;" ><p style="display:inline;">
asdasdasdasdasdasdasdasdasdasdasdasdasdasdasdasdasdasd
</p></p>
<img
src="https://www.thoughtco.com/thmb/4Bov5m2EOPlY5x6KwWNGgmefhhc=/768x0/
filters:no_upscale():max_bytes(150000):strip_icc():format(webp)/
LionelMessiBarcelona-5898d9fe3df78caebca7ac0d.jpg" alt="ronaldo">
Sorry i can't post the result, i dont have much reputation.
NOTE: This result doesn't happen if i replace the container or both of the container and child to <div> with "display:inline;" and it still doesn't happen if i replace them with other inline elements instead.
...
` is a semantic markup element, and it makes no sense for a paragraph to have paragraphs. If you need semantically neutral elements, use `` and ``.
– Amadan Oct 12 '18 at 06:17