Suppose we have created id parent and set it’s width 50% and we want to use child div with 100%(according to parent div)
when we give padding of 2px to the child div it will overflow the parent div to solve this problem we can use CSS property border-box to the child div after setting border-box property to child div it will automatically adjust the width according to the parent div does not overflow this is very useful in responsive

Withou using CSS3 border-box property
Using CSS3 border-box property

Leave a Reply

Your email address will not be published. Required fields are marked *