开发者

how to use Pseudo-classes of css in asp.net linkbutton?

In my web page there is link button and on that link button i want to add pseudo class of css which is made in another css page. I call that css page in aspx page. I want to use my pseudo class with this linkbutton .How to use this?

So my question is :I want to add this pseudo cssclass in linkbutton. how to do that?

This css want to call on linkbutton.

<style type="text/css">
lbtnLogOut:link {color:red;font-size: 12px;font-family: Verdana, Arial;font-size: 12px;}   
lbtnLogOut:visited {color:#598090;font-size: 12px;font-family: Verdana, Arial;font-size: 12px;} 
lbtnLogOut:hover {color:green;font-size: 12px;font-family: Verdana, Arial;font-size: 12px;} 
lbtnLogOut:active {color:Fuchsia;font-size: 12px;font-family: Verdana, Arial;font-size: 12px;}
</style>

On this link button i want to use.

<asp:LinkButton ID="lbtnLogOut" runat="server" OnClick="lbtnLogOut_Click" cssClass="lbtnLogOut"
          CausesValidation="False" OnClientClick="return ValidateTextBox();">Log Out</a开发者_如何学运维sp:LinkButton> 

This is not working .please someone modify it.


CSS class names are preceded by dot(.) in style-sheet. So you need to modify CSS section:

<style type="text/css">
   .lbtnLogOut:link {color:red;font-size: 12px;font-family: Verdana, Arial;font-size: 12px;}   
   .lbtnLogOut:visited {color:#598090;font-size: 12px;font-family: Verdana, Arial;font-size: 12px;} 
   .lbtnLogOut:hover {color:green;font-size: 12px;font-family: Verdana, Arial;font-size: 12px;} 
   .lbtnLogOut:active {color:Fuchsia;font-size: 12px;font-family: Verdana, Arial;font-size: 12px;}
</style>

Another thing - check case of CssClass property (you have used cssClass).


Just to clarify what i think you are trying to say:

you have a css class that you want to add to an asp:Linkbutton if so then there is an attribute called Cssclass and you can use that to point to a cssclass

<asp:LinkButton CssClass="classnamehere" />

hopefully that helps

paul

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜