Good “background-size: cover” fallbacks/shims/tricks for cross-browser compatibility on DIVs?

前端 未结 4 1600
名媛妹妹
名媛妹妹 2020-12-06 07:21

So I\'m using background-size:cover to achieve the desired effect of a background image that scales to any size of the div it\'s applied to while maintaining th

4条回答
  •  长情又很酷
    2020-12-06 08:27

    In IE8 or below, a foreground image inserted as the child of a div with defined width/height would be the only workaround:

    
    
    
        Dynamic Image Sizing
    
    
    
    
    

    If that is not equivalent, ask Stu Nicholls for further help.

    Demo:

    enter image description here

提交回复
热议问题