加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > asp.Net > 正文

asp.net – Asp Button悬停和CSS

发布时间:2020-12-16 06:35:34 所属栏目:asp.Net 来源:网络整理
导读:我有一个asp按钮控件,我已经应用了一些风格.我希望在悬停此按钮时,按钮的颜色应该改变或类似的东西. 但我不明白为什么在CSS中按钮悬停功能不起作用!! 请帮忙.另外,请告诉我们按钮悬停的最佳效果是什么. asp:Button ID="btnSearch" runat="server" CssClass="
我有一个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: Red;   
    height: 25px;

}</style>

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读