您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

纯css实现鼠标移入逐渐高亮

2026/1/10 6:47:37发布14次查看
这篇文章主要介绍了关于纯css实现鼠标移入逐渐高亮,有着一定的参考价值,现在分享给大家,有需要的朋友可以参考一下
本例子主要使用transition来实现鼠标移入之后,标签逐渐高亮,存在渐进的过程。具体的做法:将background-color,color等属性,作为一个动画来执行。
<!doctype html> <html> <head> <meta charset="utf-8"> <title>鼠标移入文本高亮显示</title> <style type="text/css"> li{ width: 400px; list-style: none; line-height: 2rem; color: black; transition: background-color 1s linear,color 1s linear; -webkit-transition: background-color 1s linear,color 1s linear; -moz-transition: background-color 1s linear,color 1s linear; -o-transition: background-color 1s linear,color 1s linear; } li:hover{ background-color: #ff3d67; color: blue; } </style> </head> <body> <ul> <li>1.秦时明月之君临天下</li> <li>2.秦时明月之沧海横流</li> <li>3.秦时明月之诸子百家</li> </ul> </body> </html>
效果对比
相关推荐:
css实现多级折叠菜单效果
css实现清除浮动问题的
以上就是纯css实现鼠标移入逐渐高亮的详细内容。
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product