0

Why are not the results the same? Both Ps and DIVs have very different results

HTML Code:

    p:first-child {
        color: #ff6347;
    }
    
    
    div:first-child {
        color: #8a2be2;
    }
   <body> 
        <p> p + p
            <p>Hello</p>
        </p>

        <div> div + p
            <p>Hello</p>
        </div>

        <p> p + div
            <div>Hello</div>
        </p>

        <div> div + div
            <div>Hello</div>
        </div>
Temani Afif
  • 245,468
  • 26
  • 309
  • 415

0 Answers0