How do I make background-size work in IE8?

Tags: css,internet-explorer-8,internet-explorer-7,background-image

Problem :

I have an image which is 250px wide by 100px high. I want to use this css rule:

background-size: 125px 50px;

How do I do it? I don't want to know how to make an image stretch to fill the div, or the browser window, or whatever else can be done with background:cover. I want the background image to be a specific size, irrespective of whether that may be larger or smaller or whatever compared to the containing div. Yes, it does (unfortunately) need to be a background image. It needs to work in IE7 and 8; background-size already covers all the other browsers.

Solution :

This question got answered intensively here:

How do I make background-size work in IE?

The most popular fix is this background-size polyfill:

    CSS Howto..

    How do I execute a javascript after Ajax load?

    How to add row top and bottom margins to gridview?

    How to make CSS zig-zag borders? [duplicate]

    How to apply CSS to dynamically generated PHP database results

    How to vertically align the baseline of text to a set point in HTML/CSS

    How to create a responsive top bar with CSS

    How to add a twitter-bootstrap icon as a CSS background-image?

    toggle show/hide for hidden menu buttons (responsive)

    How to add padding to the outside of an input in css

    How to change the color of html td element after postback in

    How to make a image stay at the bottom but not rise up

    Why does an absolutely positioned child expand container height and how to prevent this?

    How to make a button go down when scrolling? (CSS)

    yui-css grid: how to get a 1/4 - 2/4 - 1/4 grid set up?

    How do I fix this alignment issue in jQuery & CSS?

    How to add / remove html elements and content based on the browsing device?

    How to create fixed sidebar with Skeleton CSS?

    How can I exclude a hover effect with CSS

    How to set
  • Backgound color?
  • How to change dropdown submenu second level background?​

    How to prevent html div from expanding when text size is changed

    How to disable the collapsing feature in twitter bootstrap 3?

    How do you add pseudo classes to elements using jQuery?

    How to Override/Undo CSS Class Attributes for Twitter Bootstrap

    How to safely display user's text containing all html/css in rails 3

    How to apply a responsive CSS height to an element using min/max-height and height?

    How to hover a Fixed element until it reaches some point

    How would I re-position my 2nd bg image “ url(repeat_bg_right_side.png) ” to the right side of page using css?

    How to hardware accelerate a box-shadow animation in CSS?

    How to add next / previous buttons to Surface tablet touch-slideshow?