簡體   English   中英

IE7上不顯示背景圖片

[英]Background image not displaying on IE7

我的頁腳有重復的背景圖片。 它在現代瀏覽器中完美顯示。 這是在Firefox上的外觀。

在Firefox上

但是當在Internet Explorer 7上查看時

Internet Explorer 7

這是我控制后台的代碼。

的CSS

#footer {
  background: transparent url("/assets/img/template/wild_oliva_dark.png") repeat scroll 0% 0%;
}
#footer {
  text-align: left;
  background-position: center;
  background-color: #1a1a1a;
}

它不在媒體查詢中。

如您所見,為了更好地與舊版瀏覽器兼容,我使用ID為#footer<div>而不是使用<footer> 我正在使用modernizr

編輯:
在另一個成員的建議下,我添加了Selectivizr。 但是我可能實現錯誤,因為它沒有成功測試。

經過測試

編輯2:
頁腳使用響應式粘性頁腳樣式。 不知道其中的某些類是否正在影響它。

<div id="footer" class="block">

block類具有以下內容:

.block { display: table-row; height: 1px; }

看起來您的背景速記順序錯誤。

嘗試

background: transparent url("/assets/img/template/wild_oliva_dark.png") repeat scroll 0% 0%;

您也可以將selectivizr用於CSS文件。

選擇相似的現代化。

selectivizr是一個JavaScript實用程序,它可以在Internet Explorer 6-8中模擬CSS3偽類和屬性選擇器。 只需將腳本包含在頁面中,其余的將由selectivizr完成。

使用selectivizr的分步指南

1下載selectivizr

將以下代碼2插入標題中。

<script type="text/javascript" src="[JS library]"></script>
<!--[if (gte IE 6)&(lte IE 8)]>
  <script type="text/javascript" src="selectivizr.js"></script>
  <noscript><link rel="stylesheet" href="[fallback css]" /></noscript>
<![endif]--> 

3-現在可以使用css3

兼容性即6、7、8

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM