Is there a specific reason why we find max-width:97.5%
instead of 100%
in common themes such as Twenty Eleven?
Leave a Reply
You must be logged in to post a comment.
Is there a specific reason why we find max-width:97.5%
instead of 100%
in common themes such as Twenty Eleven?
You must be logged in to post a comment.
Since the TwentyEleven theme also includes some default padding and a border for (fluid) images (see CSS below), a width of 100% would push the image outside of its container’s width. This is because of how the box model works: border and padding are added to the width/height.
A better solution would be to change the box model calculation for images in this case. A CSS3 property called
box-sizing
is available for that.Note:
box-sizing
does not work in Internet Explorer 7 or lower.