1

访问时从我的导航图像中删除虚线边框时遇到问题。我认为以下样式之一应该这样做,但它似乎不起作用。

有什么想法吗?

HTML

<li class="navprint">
<a href="printcategory.html"><img src="Images/navprint.png" alt="print button"   title="print button">
 </a>
</li>

CSS

.navprint {
width: 130px;
height: 30px;
padding: 0px 0px 0px 0px;
}

.navprint:visited {
border: none;
text-decoration: none;
list-style-image: none;
outline: none;
}

.navprint:hover {
background-color: rgb(209, 244, 239);
}

.navprint:active,  {
background-color: rgb(209, 244, 239);
}
4

1 回答 1

2

If you're talking about what I think you're talking about, this has to do with the outline of a link that has :focus. So you could do something like this:

a:focus {
  border: none;
  outline: none;
}

However, note that the outline is there for a reason -- some people navigate using the keyboard or other devices, not a mouse. The focus outline tells them which link currently has focus. It's generally a bad idea to remove this, unless you replace it with another indicator. So you could do:

a:hover, a:focus {
  background-color: rgb(209, 244, 239);
  border: none;
  outline: none;
}
于 2013-01-12T16:13:29.377 回答