Skip to content

Instantly share code, notes, and snippets.

@jonkemp
Created April 2, 2012 04:17

Revisions

  1. Jonathan Kemp created this gist Apr 2, 2012.
    11 changes: 11 additions & 0 deletions css-calc.css
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,11 @@
    /* 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);
    }