简体   繁体   中英

Header background picture not displayed on ie6, ie7 and ie8

Would you know why the background picture of my header is not displayed on ie6,7 and 8 despite the fallback and how to fix this? See http://goo.gl/YbW2xb

Many thanks

.wrapper-3 header {
background-image: url('../images/.jpg'); /* fallback */
  background-image: -webkit-linear-gradient(91deg, rgba(255, 255, 255, 0.23) 0%, rgba(0, 0, 0, 0) 100%), url('../images/.jpg');
  background-image:    -moz-linear-gradient(91deg, rgba(255, 255, 255, 0.23) 0%, rgba(0, 0, 0, 0) 100%), url('../images/.jpg');
  background-image:      -o-linear-gradient(91deg, rgba(255, 255, 255, 0.23) 0%, rgba(0, 0, 0, 0) 100%), url('../images/.jpg');
  background-image:     -ms-linear-gradient(91deg, rgba(255, 255, 255, 0.23) 0%, rgba(0, 0, 0, 0) 100%), url('../images/.jpg');
  background-image:         linear-gradient(359deg, rgba(255, 255, 255, 0.23) 0%, rgba(0, 0, 0, 0) 100%), url('../images/.jpg');
  background-position: 0% 0%, center center;
  opacity: 0.95;
}

How it looks like on ie:

在此处输入图片说明

How it should look like:

在此处输入图片说明

在IE8 Native中测试

The problem is that IE<9 do not have fully support of the new HTML5 semantic tags, so the Css can not see the rules you pass to them, as you try to do on the "header" tag (see screenshot of IE8 inspector). See here for complete reference: Html5 Semantic Elements Support . Use the "HTML5Shiv" polyfill to enable the compatibility: have a look here Html5Shiv , and then debug with the Developer Inspector Bar (Press F12). For custom Css, use IE conditional stylesheets .

background: url('../images/.jpg'); /* hope you set a filename on this :D */

anyway, you probably need to use html5 shim

https://code.google.com/p/html5shiv/

enables html5 support in older browsers

尝试:

background: url('../images/.jpg'); /* fallback */

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