Resolving background-size IE8 Compatibility scenario Examples

Source: Internet
Author: User
According to Canius (http://caniuse.com/#search =background-size), background-size compatibility is IE9 and the above browsers, as shown in.

Instance code:

<!doctype html>

Effect:

(1) Chrome browser:

(2) IE8 Browser:

Compatibility scenarios:

Use the Filter property:

. parent {                width:400px;                height:400px;                margin:100px;                border:1px solid red;                Background:url (img/aaa.jpg) no-repeat Center Center;                background-size:100% 100%;                /* Next behavior key setting *                /Filter:progid:DXImageTransform.Microsoft.AlphaImageLoader (src= ' img/aaa.jpg ',  Sizingmethod = ' scale ');            }

IE8 Browser Effect:

Principle:

Filter:progid:DXImageTransform.Microsoft.AlphaImageLoader (enabled=benabled, Sizingmethod=ssize, Src=surl)

enabled: options available. A Boolean value (Boolean). Sets or retrieves whether the filter is active. True: the default value. Filter activated. False: The filter is forbidden.

Sizingmethod: options available. String. Sets or retrieves how the picture of the object that the filter acts on is displayed within the bounds of the object container. Crop: Cuts the picture to fit the object's size. Image: Default value. Increase or decrease the size boundaries of an object to fit the dimensions of the picture. scale: Scales the picture to fit the object's dimension boundaries .

src: required option. String. Specifies the background image using an absolute or relative URL address. If this parameter is omitted, the filter will not function.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.