Reputation: 33401
I am writing some css that requires background-size: 100% 100%
.
Unfortunately, as this is a css3 property, it is un supported in IE8 and below. However, I read about a hack, which I have tried using below:
#submit{
filter: progid:DXImageTransform.Microsoft.AlphaImageLoader( enabled='true'
src='/images/btn.png', sizingMethod='scale');
-ms-filter: "progid:DXImageTransform.Microsoft.AlphaImageLoader( enabled='true'
src='/images/btn.png', sizingMethod='scale')";
background: url('/images/btn.png') no-repeat;
background-size: 100% 100%;
}
#submit
is the id of a submit button.
Unfortunately, this doesn't seem to be work. Any solutions?
Upvotes: 1
Views: 13977
Reputation: 1
The best approach is to avoid AlphaImageLoader completely and use gracefully degrading PNG8 instead, which are fine in IE. If you absolutely need AlphaImageLoader, use the underscore hack _filter as to not penalize your IE7+ users. Please check this link for your reference. https://developer.yahoo.com/performance/rules.html#no_filters=
Upvotes: 0
Reputation: 7546
filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(
src='images/logo.gif',
sizingMethod='scale');
-ms-filter: "progid:DXImageTransform.Microsoft.AlphaImageLoader(
src='images/logo.gif',
sizingMethod='scale')";
This would scale it to the size of the whole page. But there is no real deal to ensure that background-size is working in IE. Even the MSDN Documentation tells that.
And btw: this is a possible duplicate of How do I make background-size work in IE?
Upvotes: 2