Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it necessary to wrap <strong>, <em>, <b>, <i> inside <p> tag, if content is not paragraph?

For example:

This is ok

<div>
    <p>some <strong>long</strong> text</p>
    <strong>- end -</strong>
    <p>some long text</p>
</div>

Or this is more semantically correct?

<div>
    <p>some <strong>long</strong> text</p>
    <p><strong>- end -</strong></p>
    <p>some long text</p>
</div>
like image 779
Jitendra Vyas Avatar asked Feb 10 '10 13:02

Jitendra Vyas


1 Answers

Academic answer: both are XHTML-compatible. Practical answer: browsers won't give a sh@t about it

like image 137
Dercsár Avatar answered Sep 19 '22 21:09

Dercsár