ASP按钮悬停和CSS [英] Asp Button hover and CSS

查看:154
本文介绍了ASP按钮悬停和CSS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有,我有一些应用风格一个asp按钮控制。我想,在这个按钮的悬停,按钮的颜色应改变或诸如此类的东西。
但我不明白为什么在CSS按钮悬停功能无法正常工作!
请帮忙。也请让我知道什么是我们可以有一个按钮悬停效果最好。

 < ASP:按钮的ID =btnSearch=服务器的CssClass =按钮的OnClick =btnSearch_Click风格=宽度:480像素;文本=搜索/>.button
{
    背景:白色;
    边框:1px的固体灰;
    FONT-FAMILY:宋体,无衬线;
    字体大小:12像素;
    字体重量:大胆的;
    颜色:#001563;
    高度:25像素;}.button:悬停
{
    背景:白色;
    边框:1px的固体灰;
    FONT-FAMILY:宋体,无衬线;
    字体大小:12像素;
    字体重量:大胆的;
    颜色:红色;
    高度:25像素;}


解决方案

请查看以下code:

 < ASP:按钮的ID =btnSearch=服务器的OnClick =btnSearch_Click风格=宽度:480像素;的CssClass =按钮的文本=搜索/>
      <风格类型=文/ CSS>
.button
{
    背景:白色;
    边框:1px的固体灰;
    FONT-FAMILY:宋体,无衬线;
    字体大小:12像素;
    字体重量:大胆的;
    颜色:#001563;
    高度:25像素;}.button:悬停
{
    背景:白色;
    边框:1px的固体灰;
    FONT-FAMILY:宋体,无衬线;
    字体大小:12像素;
    字体重量:大胆的;
    颜色:红色;
    高度:25像素;}< /风格>

I have an asp button control on which i have applied some style. I want that on hover of this button, the colour of the button should change or something of that sort. But I fail to understand why in CSS the button hover function is not working!! PLease help. Also please let me know what are the best effects we can have for a button hover.

    <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;

}

解决方案

Please check the following code:

 <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按钮悬停和CSS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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