html - React:将鼠标悬停在组件上
问题描述
我正在使用 CSS 模块来设置我的计算器应用程序的样式。当用户将鼠标悬停在组件上时,我希望组件的背景颜色发生变化。但是,我无法实现它。谁能帮我?
附加必要的 CSS 文件:
.bstyle{
height:14%;
width:25%;
}
.red{
background-color: #DC143C ;
font-size: 30px;
color: white;
}
.black{
background-color: #483c32 ;
color: white;
font-size: 30px;
}
解决方案
你可以在你的 CSS 中使用类似的东西,但你可以适应你的需要。
.bstyle{
height:14%;
width:25%;
}
.red{
background-color: #DC143C ;
font-size: 30px;
color: white;
}
.black{
background-color: #483c32 ;
color: white;
font-size: 30px;
&:hover span {
opacity: 0.7;
visibility: visible;
}
}
推荐阅读
- r - 无法在 ubuntu 外访问 Rshiny 应用程序的 http://localhost:3838/Rshiny/
- swift - 无法在 Bundle 项目中的 NSWindowController 中动态更改实例化视图,但能够在 Cocoa 应用程序中
- php - 如何搜索多维关联数组php
- javascript - 如何将 forEach 循环中的字符串合并到数组中
- javascript - 将故事书添加到 vue.js webpack 项目解析失败:意外令牌 (1:0)
I have a problem when starting storybook after adding it to a new vuejs project.
Apparently when including a .vue file it is not interpreted correctly ...
Here are all th
- django - 仅返回 Django REST Framework 中的最后一个对象
- c++ - MSVC编译器生成mov ecx,看起来没用的ecx
- docker - 无法在 docker 中推送图像
- python - 我如何找到这个数学问题的解决方案?
- c++ - 多个 std::map.insert() 使用相同的 std::pair 引用,但使用新值会导致不正确的映射值。为什么以及如何解决?