Html 如何使活动链接保持活动状态?

Html 如何使活动链接保持活动状态?,html,css,hyperlink,hover,Html,Css,Hyperlink,Hover,我试图让我的链接在页面上时保持悬停状态(因此,当它们在页面上时,链接将为蓝色/下划线)。我已经签出了其他一些页面,但它们让我感到困惑,下面是我的部分代码: a:link{ font-family: avenir; letter-spacing: .3px; text-decoration: none; } a:hover{ color: #2ab9d8; font-size: 12px; letter-spacing: .3px; text-tra

我试图让我的链接在页面上时保持悬停状态(因此,当它们在页面上时,链接将为蓝色/下划线)。我已经签出了其他一些页面,但它们让我感到困惑,下面是我的部分代码:

a:link{
   font-family: avenir;
   letter-spacing: .3px;
   text-decoration: none;
}

a:hover{
   color: #2ab9d8; 
   font-size: 12px; 
   letter-spacing: .3px;
   text-transform: uppercase;
   text-decoration: none;
   -webkit-transition: all ease-in 133ms;
   -moz-transition: all ease-in 133ms;
   -o-transition: all ease-in 133ms;
   -ms-transition: all ease-in 133ms;
    transition: all ease-in 133ms;
   border-bottom: 1px solid #2ab9d8;
}

您希望链接保持下划线和蓝色

a:link{
  font-family: avenir;
  letter-spacing: .3px;
  text-decoration: underline;
  color: blue;
}
文本装饰:下划线;颜色:蓝色施展魔法

在这里查看一个示例,并在运行时修改代码

我不确定我是否正确理解了你的问题,但我认为只需给出你想要的特定元素一个类(大多数ppl使其处于活动状态),并使用CSS创建其样式即可

<a href="#" class="active">what ever</a>


.active{
color: #2ab9d8; 
font-size: 12px; 
letter-spacing: .3px;
text-transform: uppercase;
text-decoration: none;
-webkit-transition: all ease-in 133ms;
-moz-transition: all ease-in 133ms;
-o-transition: all ease-in 133ms;
-ms-transition: all ease-in 133ms;
 transition: all ease-in 133ms;
border-bottom: 1px solid #2ab9d8;

}

.主动{
颜色:#2ab9d8;
字体大小:12px;
字母间距:.3px;
文本转换:大写;
文字装饰:无;
-webkit过渡:在133ms内轻松完成;
-moz转换:所有的易用性都在133ms内;
-o型过渡:所有缓解时间均为133ms;
-ms转换:133ms内全部缓解;
过渡:所有缓解时间均为133ms;
边框底部:1px实心#2ab9d8;
}

我不清楚您的问题:-(假设我有一个写着“工作”的链接,当你将鼠标悬停在上面时,它会变成蓝色。我希望链接在你进入页面时保持蓝色。你应该跟踪接收悬停事件的链接。你可以通过cookies或浏览器存储来实现这一点。我会进一步说,你应该简单地将
.active
选择器添加到你的源代码中最终样式定义。
a:hover,a.active{