南山黑貓
2016-03-14 14:24:43
<!doctype html><html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> ?? ?<title>豆瓣網</title>?? ?<link rel="stylesheet" href="css/douban.css"></head><body><div id="hd-header">?? ?<a href="#" class="header-logo"></a></div></body></html>css/*頭部*/#hd-header{?? ?width: 950px;?? ?height: 90px;?? ?margin: 0 auto;?? ?position: relative;?? ?border: 1px solid red;}#hd-header .header-logo{?? ?display: block;?? ?width: 154px;?? ?height: 30px;?? ?background: url(images/pp3.jpg);?? ?border: 1px solid blue;?? ?position: absolute;?? ?left: 0px;?? ?top: 29px;}文件夾里面有這張圖片 就是不顯示 ,急死我了,求解答
6 回答
已采納

qq_沖哥_0
TA貢獻40條經驗 獲得超30個贊
圖片的url 不對,你的?樣式表在CSS文件夾中,圖片在images文件夾中,CSS文件夾和images文件夾是同一級。
所以要找到圖片就要向樣式表的上一級 下面 的image文件夾中尋找。
background: url(../images/pp3.jpg); 試一試

風火3
TA貢獻11條經驗 獲得超2個贊
<style type="text/css">
#hd-header{
??? width: 950px;
??? height: 90px;
??? margin: 0 auto;
??? position: relative;
??? border: 1px solid red;
}
#hd-header .header-logo{
??? display: block;
??? width: 154px;
??? height: 30px;
??? background: url(images/pp3.jpg);
??? border: 1px solid blue;
??? position: absolute;
??? left: 0px;
??? top: 29px;
}
</style>
添加回答
舉報
0/150
提交
取消