简体   繁体   中英

-webkit-background-size: cover; equivalent for IE

Decided to open up the site I was working on in IE and to my suprise the image that I thought was going to take up the whole page actually just stayed in the center but in chrome and firefox thats not the case. I thought that -o worked on Ie but I was wrong after some research.

Current css:

.intro {
  background: url('http://www.amritray.com/wp-content/uploads/2012/01/foggy-photographs21.jpg') no-repeat center center fixed; 
  -webkit-background-size: cover;
  -moz-background-size: cover;
  -o-background-size: cover;
  -msie-background-size: cover;
  background-size: cover;
  top: 0px;
  right: 0px;
  left: 0px;
}

Current HTML

<div class='intro'>
</div>

Please Replace

-msie-background-size: cover;

with

-ms-ie-background-size: cover;

Please refer URL http://jsbin.com/jubeliga/1/edit?html,css,output to view changes

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