change font color of link button in asp.net through CSS with hover properties

StackOverflow https://stackoverflow.com/questions/16329423

  •  13-04-2022
  •  | 
  •  

Вопрос

I want to change color of link button so I made CSS like this:

.stylink 
a
{ font:10px; color:white;  }

a:hover
{ font:12px; color:#ff0; }

I have link button:

<asp:LinkButton ID="lbtn_gvinfo" runat="server" 
Text="arshad" CssClass="stylink" Font-Underline="false" ></asp:LinkButton>

This a:hover property of CSS works but a dosn't work. When I point cursor on link button it becomes yellow, but after that it remains blue.

Это было полезно?

Решение

Rather than a .stylink a selector, try .stylink a:link to set the color of a hyperlink. You may also wanted to take a look at the a:visited and a:active selectors to handle the "has already been clicked on or visited", and "has the current keyboard (tab) focus" cases, respectively.

Другие советы

Brother.. You can Apply Hover Like this.

.stylink 
{ font:10px; color:white;  }

.stylink:hover
{ font:12px; color:#ff0; }
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top