what is the difference between both of this css selectors as both of them give me same effect then makes different using '>'
- .abc > p
- .xyz p
.abc > p {
background-color: yellow;
}
.xyz p {
background-color: red;
}
<h1>Welcome to My Homepage</h1>
<div class="abc">
<p>I live in Duckburg.</p>
<h2>My name is Donald</h2>
<p>I live in Duckburg.</p>
<p>I live in Duckburg.</p>
<p>I live in Duckburg.</p>
</div>
<p>My best friend is Mickey.</p>
<p>I will not be styled.</p>
<div class="xyz">
<p>I live in Duckburg.</p>
<h2>My name is Donald</h2>
<p>I live in Duckburg.</p>
<p>I live in Duckburg.</p>
<p>I live in Duckburg.</p>
</div>