2
我試圖在我的單頁產品網站上的第一個面板中添加背景圖像。出於某種原因(我無法弄清楚)我的背景圖片不會加載。請幫忙!在CSS中添加背景圖像
HTML:
<!-- panel 1 -->
<div class="header">
<h3> Introducing the </h3>
<h1> Vespa Tribute </h1>
<p> Scheduled for release in June 2016, this limited edition scooter will only be produced 250 times. Enter your email below to be partnered with a Vespa representative who will ensure that you stay updated and informed about how be part of this exclusive venture. </p>
<input type="text" name="emailaddress" placeholder="Email address">
<button type="button">Get exclusive Info</button>
<img src="images/vespa1.png" alt="vespa" />
CSS:
/*梁板*/
.header {
background-image: url('images/image1.png');
background-size: cover;
background-repeat: no-repeat;
}
如果您在新選項卡中打開圖像,圖像是否加載?服務器訪問日誌是否顯示有用的東西? –
你的代碼看起來很好,它很可能只是無法找到圖像。確保圖像存在,image/image1.png是與CSS文件相關的正確路徑。 – Pete