我怎样才能改变一个按钮的悬停颜色? [英] How can I change a button's color on hover?

查看:110
本文介绍了我怎样才能改变一个按钮的悬停颜色?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要更改按钮的颜色上徘徊。

下面是我的解决方案,但它不能正常工作。

  a.button {
   显示:-moz-直列栈;
   显示:inline-block的;
   宽度:391px;
   高度:62px;
   背景:网址(IMG / btncolor.png)不重复;
   行高:62px;
   垂直对齐:文本中间;
   文本对齐:中心;
   颜色:#ebe6eb;
   FONT-FAMILY:Zenhei;
   字体大小:39px;
   字体重量:正常;
   字体风格:正常;
   文字阴影:#222222 1px的1px的0;
}
a.button:悬停{
     背景:#383;
}


解决方案

a.button:悬停表示那正在上空盘旋,一个链接是一个的孩子与类按钮链接

而不是去为 a.button:悬停

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 means "a link that's being hovered over that is a child of a link with the class button".

Go instead for a.button:hover.

这篇关于我怎样才能改变一个按钮的悬停颜色?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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