css - 悬停在按钮元素上不起作用
问题描述
希望这将是一件容易解决的事情,但我已经尝试寻找答案,但似乎没有什么合适的。
我正在尝试在按钮上制作悬停效果:
button {
min-width: 20vw;
max-width: 40vw;
border: none;
color: white;
font-size: 1.5vw;
padding: 15px 32px;
text-align: center;
text-decoration: none;
background-color: blue;
border-radius: 20px;
transition: 0.4s;
box-shadow: 0 8px 16px 0 rgba(0,0,0,0.2), 0 6px 20px 0 rgba(0,0,0,0.19);
}
.button:hover {
color: black;
background-color: lightcyan;
}
当我在浏览器(vivaldi & edge)中测试它时,没有任何变化。顺便说一下,测试站点是http://wyrdling.com/skulpturjagt。
PS。我尝试使用 chrome 开发人员工具,但我太新手了,无法弄清楚如何阅读它 XD
解决方案
除非您的问题中有错字,否则您使用.button:hover
. 这将适用于具有hover
. 换成button:hover
推荐阅读
- java - 使用 Gradle 构建的 Java Spring Boot 项目中偶尔出现 BeanCreationException
- kubernetes - Ingress NGINX:限制对我的一些 API 的访问
- algorithm - 算法的 theta 界是唯一的吗?
- mongodb - Mongo db 试图创建可恢复的备份
- c++ - 找不到使用 libpqxx 的 C++ 程序的 libpq 库
- sql - postgresql 中的 COALESCE 和 ARRAY - 查询
- functional-programming - 如何将 |> 运算符与需要两个参数的函数一起使用?
- flutter - 如何从另一个 bloc 访问 Bloc 状态的数据
- javascript - AngularJS:对象操作:在 js 中展平对象
- java - 具有多个参数的打印类