gpt4 book ai didi

asp.net - Asp 按钮悬停和 CSS

转载 作者:技术小花猫 更新时间:2023-10-29 12:04:26 26 4
gpt4 key购买 nike

我有一个 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>

关于asp.net - Asp 按钮悬停和 CSS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1502124/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com