Padding padding should be considered when specifying the width of the child tag?

Put padding: 0 3%, and the width of the child diva 100% and he got beyond parental diva. Is this supposed to be? During which time, the padding was already taken into account. What could be a jamb? Position display is not defined, everything is default.
March 23rd 20 at 18:59
2 answers
March 23rd 20 at 19:01
Solution
Box-sizing: border-box
How to determine where it is needed,and where not? - Bryce_Mraz commented on March 23rd 20 at 19:04
I say it is needed almost everywhere - darryl82 commented on March 23rd 20 at 19:07
Ahh I understand where the padding is 0, it and unnecessary? - Bryce_Mraz commented on March 23rd 20 at 19:10
@Bryce_Mraz, Well, supposedly Yes. If it to prescribe the distance paddinga is ignored and the unit becomes no more - darryl82 commented on March 23rd 20 at 19:13
March 23rd 20 at 19:03
Solution
A pleasure where the margin has crept in, or need to use box-sizing: border-box;to padding work correctly.
How to determine where it is needed,and where not? - Bryce_Mraz commented on March 23rd 20 at 19:06
@Bryce_Mraz, it is always better to use - blaze.Be commented on March 23rd 20 at 19:09

Find more questions by tags CSS