Answers for "what's the different between :first-of-type and :first-child"

1

difference between first of type and first child

<div class="parent">
  <h1>Child</h1>   <!-- h1:first-child, h1:first-of-type -->
  <div>Child</div> <!-- div:nth-child(2), div:first-of-type -->
  <div>Child</div>
  <div>Child</div>
</div>
Posted by: Guest on March-15-2021

Browse Popular Code Answers by Language