Skip to content

Instantly share code, notes, and snippets.

@MatthewDaniels
Created February 19, 2013 01:14
Show Gist options
  • Save MatthewDaniels/4982253 to your computer and use it in GitHub Desktop.
Save MatthewDaniels/4982253 to your computer and use it in GitHub Desktop.
Internet Explorer < version 9 background resize less mixin. An easy way to get css background-size: cover in internet explorer versions 8 and lower. Add it to your mixins less file and reference wherever you need it.
// used to make a background image (including alpha images) scale to the size of it's container in ie7 & ie8
.ie7-8-backgroundScale(@filename) {
filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='@{filename}', sizingMethod='scale');
-ms-filter: "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='@{filename}', sizingMethod='scale')";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment