Created
April 2, 2012 04:17
-
-
Save jonkemp/2280688 to your computer and use it in GitHub Desktop.
Cross Browser CSS Calc()
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 1. write it out for older browsers */ | |
/* 2. use the vendor prefix for webkit */ | |
/* 3. use the vendor prefix for moz */ | |
/* 4. include the un-prefixed version last */ | |
#foo { | |
width: 200px; | |
width: -webkit-calc(50% - 100px); | |
width: -moz-calc(50% - 100px); | |
width: calc(50% - 100px); | |
} |
Awesome. Thanks for this.
Note that -o-calc
and expression
will raise errors at most CSS validators. Probably thats why they were not included initially.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you guys.