why p inherit padding
i was wondering when padding property dont inherite why in the code below the inner div class inherit padding property
            <body>
            <style type='text/css'>
              p {
                    padding-left: 0px; 
                  }
  
              </style>
               <div style="padding-left: 100px;">
                   <p>child p1
                        <div class='p'>div</div>
                   </p>
                   <p>child p2</p> 
              </div>
             </body>
why p inherit padding
===

i was wondering when padding property dont inherite why in the code below the inner div class inherit padding property
            <body>
            <style type='text/css'>
              p {
                    padding-left: 0px; 
                  }
  
              </style>
               <div style="padding-left: 100px;">
                   <p>child p1
                        <div class='p'>div</div>
                   </p>
                   <p>child p2</p> 
              </div>
             </body>