" /> " /> "/>

ASP.NET giving style to Linklabel

67 Views Asked by At

I'm a novice at asp.net and I want to give style to a linklabel. My code as follows:

<asp:LinkButton ID="lnkUser" runat="server" CssClass="userlabel">Guest</asp:LinkButton>
.userlabel {
    display:inline-block;
    text-decoration: underline;
    background-color:coral;
}

I am suspicious about jQuery overrides Site.css code. Is it possible? What am I doing wrong?

1

There are 1 best solutions below

0
Bharatsing Parmar On BEST ANSWER

You can use !important in css

<asp:LinkButton ID="lnkUser" runat="server" CssClass="userlabel">Guest</asp:LinkButton>

Will render in html as:

<a id="lnkUser" class="userlabel" href="javascript:__doPostBack('lnkUser','')">Guest</a>

So you can add style for that like bellow to give importance

a.userlabel {
    display:inline-block !important;
    text-decoration: underline !important;
    background-color:coral !important;
}