I use padding in many of my projects, and it would be handy if I could substract the padding from the width, it is possible ?
if:
width:100%;
and
padding: 20px;
=
100% - 40px ?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can use
box-sizing: border-boxto make thepaddingbe counted as part of thewidth.Here’s a quick demonstration: http://jsfiddle.net/thirtydot/DNs2u/
More info: