简体   繁体   中英

Background Image not loading in IE

Following is my fiddle and the only issue I am facing is that my background image is not displaying only in internet explorer. Kindly let me know how to fix this issue. I tried alot but failed

FIDDLE

CODE

.header2 {
    background: #6cab26;
    background-image: url(http://freepsdgraphics.net/wp-content/uploads/2012/04/free-web-header-download-550x172.jpg), #5D5846;
    background-image: url(http://freepsdgraphics.net/wp-content/uploads/2012/04/free-web-header-download-550x172.jpg), -moz-radial-gradient(circle, #FFFFFF 0%, rgba(93,88,70,1) 100%);
    background-image: url(http://freepsdgraphics.net/wp-content/uploads/2012/04/free-web-header-download-550x172.jpg), -webkit-gradient(radial, center center, 0px, center center, 460, color-stop(0%, #FFFFFF), color-stop(100%, rgba(93,88,70,1)));
    background-image: url(http://freepsdgraphics.net/wp-content/uploads/2012/04/free-web-header-download-550x172.jpg), -webkit-radial-gradient(circle, #FFFFFF 0%, rgba(93,88,70,1) 100%);
    background-image: url(http://freepsdgraphics.net/wp-content/uploads/2012/04/free-web-header-download-550x172.jpg), -o-radial-gradient(circle, #FFFFFF 0%, rgba(93,88,70,1) 100%);
    background-image: url(http://freepsdgraphics.net/wp-content/uploads/2012/04/free-web-header-download-550x172.jpg), -ms-radial-gradient(circle, #FFFFFF 0%, rgba(93,88,70,1) 100%);
    background-image: url(http://freepsdgraphics.net/wp-content/uploads/2012/04/free-web-header-download-550x172.jpg), radial-gradient(circle, #FFFFFF 0%, rgba(93,88,70,1) 100%);
    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#b9b8b1', endColorstr='#5d5846', GradientType=1 ), progid:DXImageTransform.Microsoft.AlphaImageLoader(src="http://freepsdgraphics.net/wp-content/uploads/2012/04/free-web-header-download-550x172.jpg" , sizingMethod='scale'); 
    background-position: center center;
    background-repeat: no-repeat;
    width:100%;
    height:210px;
    text-align: center;
    vertical-align:middle !important;
    color: red;

}

Just remove your

background-image: url(http://freepsdgraphics.net/wp-content/uploads/2012/04/free-web-header-download-550x172.jpg) #5D5846; 

and add

background-image: url(http://freepsdgraphics.net/wp-content/uploads/2012/04/free-web-header-download-550x172.jpg);

You can try using the Ultimate CSS Gradient generator tool which also supports IE9.

just copy the relevant css (the one that contain gradient code) to the tool and check the ie9 support checkbox.

Also note that it states that in order for IE9 to support it, you need to remove the filter:

<!--[if gte IE 9]>
  <style type="text/css">
    .header2 {
       filter: none;
    }
  </style>
<![endif]-->

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM