PS: 如果您仔细观察悬停在链接上最右侧的几个像素保持黑色的酒吧。为什么是这样,我该如何解决它?CSS导航栏指示问题
当前导航栏的代码如下:
HTML:
<body>
<div class="navbar">
<a href="home.html" id="current">-home</a>
<a href="about.html">about</a>
<a href="store.html">store</a>
<a href="contact.html">contact</a>
</div>
</body>
CSS:
.navbar{
width: 75%;
background-color: black;
margin-left: auto;
margin-right: auto;
margin-top: 15px;}
.navbar a:link, a:visited{
background-color: black;
color: white;
text-decoration: none;
text-transform: uppercase;
border-right: 2px solid white;
font-weight: bold;
font-family: verdana;
font-size: 37px;
text-align: center;
padding-left: 5px;
padding-right: 5px;}
.navbar a:hover, a:active, a:focus{
background-color: #4A4A4A;
text-decoration: underline;}
#current a:link, a:visited{
background-color: red;}
你可以通过代码知道,我想将家庭链接的颜色设置为红色。但是这显然不起作用。我应该怎么做呢?
谢谢!奇迹般有效! – Prooz