[英]Background image appearance in IE8
我有一個div,其類別為“ gradient_back”,我對其應用了背景。 在chrome和mozilla中,div看起來還可以。 但是在ie8中,它並沒有根據需要進行擴展。
這是“ gradient_back”類:
.gradient_back{
width:100%;
float:left;
background:url(images/gradient.gif) repeat-x 0 0;
background-size:auto 100%;
}
我不了解ie8中的這種奇怪行為。 請幫助我解決問題。
我不了解ie8中的這種奇怪行為。
支持background-size
的Internet Explorer的第一個版本是版本9。
請幫助我解決問題。
在較舊的瀏覽器中,我會使用CSS漸變和后備顏色。
或者,您可以嘗試將背景圖像定位在100% 100%
而不縮放。
I think so, you should change some html like this.
<style type="text/css">
.top-gradient{
width:100%;
float:left;
background:url(images/top-gradient.gif) repeat-x 0 top;
}
.bottom-gradient{
width:100%;
float:left;
background:url(images/bottom-gradient.gif) repeat-x 0 bottom;
}
</style>
<div class="top-gradient">
<div class="bottom-gradient">Your page content will go here</div>
</div>
IE8不支持CSS background-size
功能。 因此,您的background-size:auto 100%
不會有任何效果; 不會發生縮放,並且背景將在IE8中顯示,而不會拉伸以填充框。
您有幾種選擇:
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.