如何在悬停时更改按钮的颜色? [英] How can I change a button's color on hover?

查看:20
本文介绍了如何在悬停时更改按钮的颜色?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要更改悬停按钮的颜色.

I need to change the color of a button on hover.

这是我的解决方案,但它不起作用.

Here is my solution, but it doesn't work.

a.button {
   display: -moz-inline-stack;
   display: inline-block;
   width: 391px;
   height: 62px;
   background: url("img/btncolor.png") no-repeat;
   line-height: 62px;
   vertical-align: text-middle;
   text-align: center;
   color: #ebe6eb;
   font-family: Zenhei;
   font-size: 39px;
   font-weight: normal;
   font-style: normal;
   text-shadow: #222222 1px 1px 0;
}
a.button a:hover{
     background: #383;
}

推荐答案

a.button a:hover 的意思是悬停在上面的链接是具有 按钮".

a.button a:hover means "a link that's being hovered over that is a child of a link with the class button".

改为使用 a.button:hover.

这篇关于如何在悬停时更改按钮的颜色?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆