htmlcsssassfrontendbox-sizing

Is box-sizing also a non-inheritable property just like margins and border properties are?


I'm new to css and I tried playing with css inheritane. When I added box-sizing:border-box property to body , it doesn't get inherited by its child elements( in my case a <section> element). Is it just like other non inheritable properties like margins and borders ?


Solution

  • No, box-sizing: border-box is not inherited by child elements.

    You can check the specification here https://drafts.csswg.org/css-ui-3/#box-sizing