background-size property is not working in ie8 and ie7

Yes background-size is not working in IE 8 and IE 7. Because the background-size property is a CSS3 property.

Bellow CSS working fine in Chrome, Firefox and all IE version greater than 9. And bellow piece of code will not work in IE7 and IE8.

.headerlinkunsel {
background-image: url("../Images/unsel-tab.gif");
background-repeat: repeat-x;
color: #ffffff;
font-size: 12px;
height: 20px;
text-align: left;
text-decoration: none;
background-size:cover;
}

To get this issue resolved in IE8 and IE7, i have followed bellow steps.

Step 1. Download the backgroundsize.min.htc file. Please click here to download.

Step 2. And put the backgroundsize.min.htc file in the same path where your page is placed.

Step 2. Write the bellow style to focus only IE version bellow 9

<!--[if lt IE 9]>
      
        .headerlinksel {
        background-image: url("../Images/sel-tab.gif");
        background-repeat: repeat-x;
        color: #ffffff;
        font-size: 12px;
        padding-left: 4px;
        text-align: left;
        text-decoration: none;
        background-size:cover;
        behavior: url('backgroundsize.min.htc');
        }
<![endif]-->

Please put your valuable comment, if this seems to be helpful for you.

Leave a comment