如何CSS样式设置为asp.net按钮? [英] How to set css style to asp.net button?

查看:652
本文介绍了如何CSS样式设置为asp.net按钮?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个ASP:按钮,我用CssClass属性CSS样式在 ASP:按钮,但这些样式不工作。当我使用 ASP:LinkBut​​ton的这些样式正在well.I不想对任何风格的主题或皮肤。

I have a asp:Button, I used css styles with cssClass property in asp:Button, but those styles are not working. When I use asp:LinkButton those styles are working well.I don't want any themes or skins for styles.

这是我的ASP页:

<asp:Button CssClass="smallButton" Text="Sign In" runat="server" ID="submit"></asp:Button>

这是我的CSS:

.smallButton 
{
  //styles
}

当我改变的asp:按钮到ASP:LinkBut​​ton的

When I change asp:Button to asp:LinkButton

<asp:LinkButton Text="Sign In" runat="server" ID="submit" CssClass="smallButton"></asp:LinkButton>

<span class="smallButton"><asp:LinkButton Text="Sign In" runat="server" ID="submit"></asp:LinkButton></span>

样式运作良好。唯一的问题用asp:Button控件

styles are working well. Only problem with the asp:Button control

推荐答案

我发现了编码...

 input[type="submit"]
    {
     //css coding
    }
 input[type="submit"]:Hover  
    {
     //css coding
    }

这是我的问题解决.....
感谢大家的宝贵答案.......

This is the solution for my issue..... Thanks everyone for the valuable answers.......

这篇关于如何CSS样式设置为asp.net按钮?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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