PS:如果您在将鼠标悬停在链接上时仔细查看该栏,则最右侧的几个像素会保持黑色。为什么会这样,我该如何解决?
当前导航栏的代码如下:
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;}
从代码中可以看出,我正在尝试将主页链接的颜色设置为红色。但这显然行不通。我应该怎么做?