Since you can't put <h2>
tags and lists and such inside <p>
tags. How to go about creating articles with <h2>
tags and lists. Can I replace the <p>
tag with a <div>
? Or just leave out the <p>
tag altogether?
Article example 1: ( No H tags )
<article>
<header>
<img src="">
<h1></h1>
<p></p>
</header>
<p>
<span style="width:100%;display:block;"><strong>hf</strong></span>
<span style="width:100%;display:block;"><strong>fhfg</strong></span>
</p>
</article>
Article example 2: ( With H tags )
<article>
<header>
<img src="">
<h1></h1>
<p></p>
</header>
<p>
<span style="width:100%;display:block;">ghjghj</span>
<br>
<span style="width:100%;display:block;">ghjghj</span>
</p>
<h2>ghjghjghjhhgjg</h2>
<span style="width:100%;display:block;">ghg</span>
<p></p>
As soon as the <h2>
tag is introduced, the <p>
tag gets automatically closed and the <h2>
tag, and any content that follows will be placed outside the <p>
tag.
Is the second example bad for SEO? And if so, would using a <div>
tag in place of the <p>
tags in example one be any better?