Skip to content

Instantly share code, notes, and snippets.

@bbg
Forked from jonkemp/css-calc.css
Created June 14, 2017 16:46
Show Gist options
  • Save bbg/155560af51aac52ef8e0b2865182f303 to your computer and use it in GitHub Desktop.
Save bbg/155560af51aac52ef8e0b2865182f303 to your computer and use it in GitHub Desktop.
Cross Browser CSS Calc()
/* 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);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment