【发布时间】:2018-01-02 13:07:00
【问题描述】:
我想在导航栏上方放置一个图像,然后在导航栏后面也放置一个背景图像。
导航栏上方图片的当前html:
<div class="viewport-1"></div>
导航栏上方图片的当前 CSS:
.viewport-1
{
background-size: cover;
background-image: url('saultitle.png');
height: 100vh;
}
当我将鼠标悬停在括号中的链接上时,图像会在 CSS 表中链接,并且网页中应该存在图像的间隙 - 但是它没有显示。
导航栏图像没有间隙,因为它是背景图像,但它也在 CSS 表中链接。
导航栏 HTML
<div id="nav">
<table class="nav">
<tr>
<td><a href="#getting-his-start">Getting his Start</a></td>
<td><a href="#cinematic-revolution">Cinematic Revolution</a></td>
<td><a href="#experimental-phase">The Experimental Phase</a></td>
<td><a href="#logos-made-to-last">Logos Made to Last</a></td>
<td><a href="#the-nect-big-thing">The Next Big Thing</a></td>
<td><a href="#his-influence-today">His Influence Today</a></td>
</tr>
</table>
</div>
导航栏 CSS
.nav {
background-image: url('goldenarm.png');
width:100%;
padding:1em 0;
关于他们为什么不显示的任何建议?
【问题讨论】:
-
您在 css 中缺少 viewport-1 的第一个括号。这是问题中的拼写错误或问题的解决方案。
-
嗨,这只是一个错字-那里有一个括号
标签: html css image background