I've noticed a strange behaviour in how the browsers interpret the following code:
<h2>Maecenas aliquet lorem id urna vehicula</h2>
<p>
<ul class="liststyle">
<li>Curabitur</li>
<li>Pharetra</li>
<li>Convallis</li>
</ul>
</p>
When I tried to give this some style I tried the following selector:
p li {
font-family: Verdana, sans-serif;
font-size: 14px;
}
I know that a better choice is "ul li" but my selector (p li) should work and it doesn't, so looking the developer tools in Chrome and Firefox this is how they interpret the code:
<p>
</p>
<ul class="liststyle">
<li>Curabitur</li>
<li>Pharetra</li>
<li>Convallis</li>
</ul>
<p></p>
The only difference is that Chrome also shows the entity ( ) that I put there trying to fix the problem, but still creates two paragraphs. I'm looking for an explanation of this phenomena. Thanks.