有人可以建议在HTML中更改“鼠标悬停时的虚线文本颜色”。我正在尝试下面的代码,但没有成功。请帮帮我。
这是我的css-------------

.gvb-theme-cpCaroToolTipList {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 150px;
/*  color:#ffffff;*/
}

.gvb-theme-cpCaroToolTipList a {
    color: #003c72;
    line-height: 30px;
    padding: 5px 10px;
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.gvb-theme-cpCaroToolTipList a:hover {
    color:#ffffff;
    text-align:center;
    background-color:#003C72;
    width:150px;
    padding:5px 10px;
}

这是我的HTML代码-------------
<div class="gvb-theme-carosuleTooltipMargin">
<div class="gvb-theme-cpCaroToolTipList">
<a href="#">
<img src="img/cp_star.png" class="gvb-theme-cpSetStarIcon" > <span>CONTO LA LIBRETTA LIBRETTA</span>
</a>
</div>
</div>

最佳答案

尝试添加这个class,以便在悬停时在文本下面添加点:

.gvb-theme-cpCaroToolTipList span:hover {
   border-bottom: 1px dotted #ffffff;
    text-decoration: none;
}

根据需要更改颜色部分等:1px dotted #101010;
http://jsfiddle.net/csdtesting/308wakq6/

关于html - 如何更改文本溢出的颜色:将鼠标悬停在其上,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/26237497/

10-12 00:03
查看更多