[問題] background-image顯示出不來
head有寫
<link rel="stylesheet" type="text/css" href="img/main.css" />
body裡
<div class="article">
<div class="content">
...
</div>
</div>
main.css裡
.article
{
background-image: url(img/2.jpg);
background-repeat: no-repeat;
background-position:center;
background-attachment: fixed;
}
.content
{
margin: 2cm 0 1cm 5cm;
}
這樣寫圖片出不來
但如果寫
<div class="article" style="background-image: url(img/2.jpg);">...</div>
就跑的出來
請問有高手可以指導嗎QAQ
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 114.40.57.24
※ 文章網址: https://www.ptt.cc/bbs/Web_Design/M.1440177037.A.396.html
推
08/22 01:30, , 1F
08/22 01:30, 1F
→
08/22 11:29, , 2F
08/22 11:29, 2F
推
08/22 11:43, , 3F
08/22 11:43, 3F
已解決,真的是路徑問題,感謝!
※ 編輯: upo19 (114.40.57.24), 08/22/2015 16:52:34
推
08/24 16:14, , 4F
08/24 16:14, 4F
謝謝提醒~
就是css裡面的錯了XD
※ 編輯: upo19 (114.39.135.56), 08/25/2015 01:34:55