[英]Why is there no background image in IE7?
ie7中缺少背景圖片; 只有ie7有問題。
該網站在這里http://www.competition4ct.com/ 。
這是我用於背景圖像的調用:
html { background : ("source-file.png");}
為什么沒有出現背景圖片?
您似乎缺少文件名前面的url
。 它應該是:
body {background-image: url(source-file.png);}
請注意,我在這里也使用了background-image
,而不是background
。 您可以使用background
快捷方式,然后它看起來像這樣:
body {background: transparent url(source-file.png) left top no-repeat;}
在body
標簽上放置背景也更常見,盡管我確信html
標簽在大多數情況下也可以使用。
不確定這是否會導致問題,但您需要將“url”放在括號前。 也可以不傷害使身體有背景。 最后,只是 'background' 屬性可能需要更多輸入,因為您一次設置了幾件事(並且您只是嘗試制作 bg 圖像)。 所以:
html { background-image : url("source-file.png"); }
或者
body { background-image : ("source-file.png");}
有關更多信息,請參閱:
http://www.w3schools.com/css/pr_background.asp
讓我們知道這些解決方案是否能解決您的問題。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.