一、鼠标悬浮时,字体颜色从左到右依次变化
<!
DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>box-size</title> <style type="text/css"> h1{ letter-spacing: 100px;/*必要*/ position: relative;/*必要*/ cursor: pointer; list-style-type: none; } h1:before{ content: attr(title);/*必要*/ width: 0%;/*必要*/ position: absolute;/*必要*/ z-index: 2;/*必要*/ color: #e49d99; white-space: nowrap; overflow: hidden;/*必要*/ transition: 3s;/*必要*/ } h1:hover:before{ width: 100%;/*必要*/ } </style> </head> <body> <h1 title="ABCDABCD">ABCDABCDE</h1> </body> </html>

 

相关文章:

  • 2022-12-23
  • 2021-12-09
  • 2021-06-19
  • 2021-08-09
  • 2022-01-25
  • 2021-09-17
猜你喜欢
  • 2021-10-22
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-20
  • 2021-09-27
  • 2021-11-01
相关资源
相似解决方案