Is it possible to make a div 50px less than 100% in pure CSS? I want the <div> to be only 50px less than 100%. I don’t want any JavaScript.
Is it possible to make a div 50px less than 100% in pure CSS?
Share
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.
Yes you can. Without using the IE’s
expression(), you can do that in CSS3 by usingcalc().Demo: http://jsfiddle.net/thirtydot/Nw3yd/66/
This will make your life so much easier. It is currently supported in the 3 main browsers: Firefox, Google Chrome (WebKit), and IE9: http://caniuse.com/calc
MDN: https://developer.mozilla.org/en/CSS/-moz-calc