这是我的 HTML 的一部分。当您将鼠标悬停在超链接上时,超链接不会改变颜色,即使我已将它们编码为。你知道为什么不吗?
<div class = 'container' >
<header> name goes here Illustration</header>
<nav>
<!-- Site navigation menu -->
<ul>
<li><a href = 'index.html'>home</a></li>
<li><a href = '#'>film & Game </a></li>
<li><a href = '#'>sketchbook</a></li>
<li><a href = '#'>paintings</a></li>
<li><a href = 'contact.html'>contact/Info</a></li>
</ul>
</nav>
<!-- Main content -->
<div id='content' > </div>
</div>
这是我的 CSS 的一部分
a: link{
color: white;
font-size: 40px;
font-family: Modern No. 20;
text-decoration: none;
}
a: visited{
color: yellow;
font-size: 20px;
font-family: Modern No. 20;
text-decoration: none;
}
a: hover{
color: blue;
text-decoration: underline;
}
最佳答案
需要去掉a:
和link
之间的空格,即:
a:link{
color: white;
font-size: 40px;
font-family: Modern No. 20;
text-decoration: none;
}
a:visited{
color: yellow;
font-size: 20px;
font-family: Modern No. 20;
text-decoration: none;
}
a:hover{
color: blue;
text-decoration: underline;
}
关于html - 超链接不会在悬停或访问时改变颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17477179/