有一多行垂直菜单,借鉴网上菜单效果,显示正常,把菜单中的文字添加上链接,效果有点问题,先上代码:
.list_dt{
background:rgb(0,37,82);
color:rgb(255,255,255);
width:160px;
padding:025px024px;
height:68px;
line-height:68px;
cursor:pointer;
overflow:hidden;
text-overflow:ellipsis;
white-space:nowrap;
position:relative;
}
.list_dt:hover{
background:rgb(0,37,82);
color:rgb(235,141,41);
}
.list_dt:hover._after{
display:block;
width:6px;
height:40px;
position:absolute;
left:0;
top:0;
margin-top:10px;
background:rgb(235,141,41);
}#open{
background:rgb(0,37,82);
color:rgb(235,141,41);
}#open._after{
display:block;
width:6px;
height:40px;
position:absolute;
left:0;
top:0;
margin-top:10px;
background:rgb(235,141,41);
}
基本信息
班级
预警信息
在没有给文字添加链接之前,文字颜色为白色,鼠标放到文字上,文字显示橙色,文字前面也有6个像素的区域变成黄色,点击这个文字,文字也变成橙色,文字前的区域保持黄色,鼠标移动到其他文字,该文字变橙色,该文字前面的区域也变成黄色,点击其他文字,该文字变色,该文字前区域保持橙色,之前点击的文字那里恢复原来样式,也就是文字恢复为白色,文字前区域不显示橙色。
现在给这些文字添加上a标签以后,我需要的效果还是同刚才描述的一样,为此添加了A标签相关样式,
a:link{
color:rgb(255,255,255);
}
a:hover{
color:rgb(235,141,41);
}
a:visited{
color:rgb(255,255,255);
}
我在JS中添加了这样一段
$(".list_dta").on("click",function(){
$(this).css("color","orange");
});
但是不起作用。
分 -->
|