我有一个 asp 按钮控件,我在上面应用了一些样式。我希望鼠标悬停在该按钮上时,按钮的颜色应该发生变化或类似的情况。
但我不明白为什么在 CSS 中按钮悬停功能不起作用!
请帮忙。另请让我知道按钮悬停的最佳效果是什么。
<asp:Button ID="btnSearch" runat="server" CssClass="button" OnClick="btnSearch_Click" Style="width: 480px;" Text="Search" />
.button
{
background: white;
border: solid 1px grey;
font-family: Arial, sans-serif;
font-size: 12px;
font-weight: bold;
color: #001563;
height: 25px;
}
.button:hover
{
background: white;
border: solid 1px grey;
font-family: Arial, sans-serif;
font-size: 12px;
font-weight: bold;
color: Red;
height: 25px;
}
请检查以下代码:
<asp:Button ID="btnSearch" runat="server" OnClick="btnSearch_Click" Style="width: 480px;" CssClass="button" Text="Search" />
<style type="text/css">
.button
{
background: white;
border: solid 1px grey;
font-family: Arial, sans-serif;
font-size: 12px;
font-weight: bold;
color: #001563;
height: 25px;
}
.button:hover
{
background: white;
border: solid 1px grey;
font-family: Arial, sans-serif;
font-size: 12px;
font-weight: bold;
color: Red;
height: 25px;
}</style>
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)