去除el-button的默认hover
时间: 2023-11-20 20:22:47 浏览: 222
您可以使用以下CSS代码来去除el-button的默认hover效果:
```
.el-button:hover {
background-color: transparent !important;
color: inherit !important;
box-shadow: none !important;
}
```
这将去除默认的背景色、文本颜色和阴影效果,使其不再显示hover效果。
相关问题
去掉el-button默认hover样式
你可以通过CSS来去掉el-button默认的hover样式。可以使用以下代码:
```css
.el-button:hover {
background-color: transparent;
color: inherit;
border-color: inherit;
}
```
这段代码会将el-button的hover样式的背景颜色、文字颜色和边框颜色都设置为继承,从而去掉默认的hover样式。
elementui中取消el-button的hover
效果应该怎么做?
你可以通过重写element-ui中el-button组件的:hover伪类来取消hover效果。具体做法如下:
1.在自己的样式文件中定义一个类,例如.no-hover。
2.使用!important关键字覆盖element-ui中的:hover伪类,并将其样式设置为none。
3.将no-hover类应用到el-button组件上。
代码示例如下:
```
.no-hover:hover{
background-color: none!important;
border-color: none!important;
color: inherit!important;
}
<el-button class="no-hover">取消hover效果</el-button>
```
通过这种方式,就可以在不影响其他el-button组件的情况下取消el-button的hover效果了。