css – 更改div悬停时的链接颜色

前端之家收集整理的这篇文章主要介绍了css – 更改div悬停时的链接颜色前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
当我悬停div时,如何更改链接颜色?

我试着用:

  1. #voltarTEST {
  2. width: 80px;
  3. height: 62px;
  4. padding-top: 16px;
  5. background-image: url(../img/multiLangImage/Seta11.png);
  6. background-repeat: no-repeat;
  7. }
  8. #seguinteBtn {
  9. width: 80px;
  10. height: 62px;
  11. padding-top: 16px;
  12. background-image: url(../img/multiLangImage/Seta21.png);
  13. background-repeat: no-repeat;
  14. text-decoration: none;
  15. color: #777;
  16. }
  17. #seguinteBtn:hover {
  18. background-image: url(../img/multiLangImage/Seta22.png);
  19. background-repeat: no-repeat;
  20. text-decoration: none;
  21. color: #FFF;
  22. }
  23. #voltarText {
  24. /* padding-right: 10px;*/
  25. padding-left: 30px;
  26. }
  27. #voltarNEText {
  28. /* padding-right: 10px;*/
  29. padding-left: 30px;
  30. }
  31. #voltarTEST:hover {
  32. background-image: url(../img/multiLangImage/Seta12.png);
  33. background-repeat: no-repeat;
  34. }
  35. #voltarTEST a {
  36. text-decoration: none;
  37. font-size: x-small;
  38. font-family: Verdana;
  39. text-decoration: none;
  40. color: #999;
  41. }
  42. #voltarTEST a:hover {
  43. text-decoration: none;
  44. font-size: x-small;
  45. font-family: Verdana;
  46. text-decoration: none;
  47. color: #FFF;
  48. }
  49. #dataUltimaSincMSG {
  50. margin-bottom: 0;
  51. }
  52. #estadoSinc {
  53. margin-bottom: 0;
  54. }

但这不起作用,当我将鼠标悬停在链接上时,这只会改变颜色.

解决方法

添加这个:
  1. #voltarTEST:hover a{
  2. text-decoration: none;
  3. font-size: x-small;
  4. font-family: Verdana;
  5. text-decoration: none;
  6. color:#FFF;
  7. }

猜你在找的CSS相关文章