按钮悬停颜色变化

时间:2018-08-24 14:57:02

标签: html css

我创建了一个抽象类型的按钮(本来是一朵云,但是已经变得不一样了!)

但是现在我无法更改按钮中所有元素的悬停颜色-有人可以看到我在那部分做错了吗?

这是我正在使用的用于按钮的代码,这些代码是从我观看过的各种教程中共同学到的。

An application must be listening on the right port. Instead of hardcoding the port, use the $PORT environment variable

2 个答案:

答案 0 :(得分:4)

You can use the "hover" properties same :

.btn:hover,
.btn:hover:before,
.btn:hover:after {
    background-color: #886633;
}

答案 1 :(得分:1)

此代码应该有效。

.btn:hover {
 background-color: red;
 }
.btn:hover:before {
 background-color: red;
}
.btn:hover:after {
 background-color: red;
}

唯一不清楚的是margin-left: calc( ( #{75) );。我已经附上了相同的代码笔。 https://codepen.io/anon/pen/GXpbLo

相关问题