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.
This is my asp page:
<asp:Button CssClass="smallButton" Text="Sign In" runat="server" ID="submit"></asp:Button>
This is my CSS:
.smallButton
{
//styles
}
When I change asp:Button to asp:LinkButton
<asp:LinkButton Text="Sign In" runat="server" ID="submit" CssClass="smallButton"></asp:LinkButton>
or
<span class="smallButton"><asp:LinkButton Text="Sign In" runat="server" ID="submit"></asp:LinkButton></span>
styles are working well. Only problem with the asp:Button control
With Hover effects :
http://www.parallelcodes.com/asp-net-button-css/
The answer you mentioned will be applied to all buttons. You should try this:
And make sure you add this to your button:
You could just style the input element in your css file. That is then independent of ASP.NET.
With the
CssClass
you can assign the"input"
class to it.I Found the coding...
This is the solution for my issue..... Thanks everyone for the valuable answers.......
You can use
CssClass
attribute and pass a value as a css class nameYou can assign a
class
to yourASP.NET
Button and then apply the desired style to it.CSS: