目前我已经设置了我的站点,以便链接在鼠标悬停时带有下划线。我如何获得它以便某些链接忽略它?
我的代码:
a:hover {
border-bottom: solid #000 2px !important;}
我不想应用它的 HTML:
<div class="banner">
<h1><a href="home.html" class="titleLink">Brian Funderburke Photography & Design</a></h1>
我假设我可能将 text-decoration: none 应用于我的 h1,但问题是在 css 中选择我的 h1。我的不同尝试都没有奏效,所以我认为我写错了选择器。在这种情况下我将如何编写选择器?
最佳答案
首先,删除 !important
。这是不必要的,并且使事情变得比他们需要的更困难。
然后,假设 .titleLink
是您的“不要在此类上放置悬停效果”,只需...
a.titleLink:hover {
border-bottom: none;
}
完成。
关于html - 如何获得链接以忽略鼠标悬停时的悬停?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33303573/