[英]Image path: Jumbotron background image doesn't show after publishing to server
我正在使用簡單的HTML
代碼來jumbotron
具有背景的jumbotron
,如下所示:
<div class="jumbotron" style="background: url('../../img/pills.jpg') no-repeat; background-size:cover">
它在localhost上運行良好,但是當我將Project文件發布到服務器時,沒有顯示圖像。
可能是什么問題?
可能要檢查服務器上圖像文件的路徑,並確保background-image url反映正確的路徑
我通過在服務器Url('/Folder2/Folder1/img/pills.jpg')
而非服務器上提供確切路徑解決了該問題
url('../../img/pills.jpg')
。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.