In your example, padding of child elements is set as a percentage, and that percentage is calculated from the size of the parent container (whether a parent DIV or perhaps the entire page itself).
.container { width: 1000px; background: grey; height: 500px; } .sectionLeft, .sectionMiddle, .sectionRight { float: left; width: 31%; height: auto; padding: 1%; background-color: red; }
I've added a class for a parent div ("container"). We will modify its width, so that you can visualize the effect it has on enclosed elements.
With the width of parent container arbitrarily set to 1000 pixels, and the padding of each child expressed as 1%, each child element will have 10 pixels of padding (1000 * .01 = 10). The width of each child element is 310 pixels (31%). That's 930 pixels of content, plus 60 pixels of total padding (10 pixels on either side of three elements), for 990 pixels of used width in a parent that provides 1000 pixels total. See codepen.
Now, when we change the padding to 6%, we will have 60 pixels of negative space surrounding each child element (instead of 10), for a combined total of 360 pixels (60 pixels on either side of each child (120), times 3 child elements). The 930 pixels of content added to the 360 pixels of total padding (1290) blows past the 1000 pixel width of the parent container, breaking the 3-column layout. See codepen.
So you can see that the 1% padding of the first codepen (60 pixels total) is not the same as the 6% padding of the second codepen (360 pixels total), because the padding is derived from the width of the parent.