我最近通过Dreamweaver上的CSS在我的网站背景中添加了一张图片。我已将css文件和图像文件保存到服务器,但这仍未出现在我的网站上。我哪里出错?
我正在使用的代码是background-image:url(../ images / Christmasback.png);而且我把它放在体内。在浏览器的Dreamweaver视图中,它可以正常工作
文件夹结构
Site root
- WWW
- CSS
- site.css
- Images
- Christmasback.png
- index.html
CSS代码是:
html,body {
margin: 0;
padding: 0;
color: #333;
font-family: Arial, Helvetica, sans-serif;
font-weight: normal;
font-size: 11px;
line-height: 16px;
background-image: url(../images/Christmasback.png);
background-repeat: repeat;
background-color: #000000;
}
和标题:
#header {
position: relative;
height: 90px;
background-color: #000000;
width: 908px;
font-family: Arial, Helvetica, sans-serif;
background-image: url(../images/xmas-header.gif);
}
答案 0 :(得分:1)
您可能需要刷新缓存以查看更新的图像。
在Windows / Linux中按浏览器中的Ctrl + F5,在Mac上按Cmd + R
您希望在开发时查看“到期内容”以供将来参考:
http://developer.yahoo.com/performance/rules.html
在Add a Expires或Cache-Control Header标题下,它允许您为images / css等添加到期日期,以便浏览器在指定时间获得最新版本。