asp:LinkButton and CssClass

  • Thread starter Thread starter Alex
  • Start date Start date
A

Alex

I have an asp linkbutton declared as follows:
<asp:LinkButton ID="LinkButton1" runat="server" CssClass="tt">ASP Link
Button</asp:LinkButton>

My CSS classes are declared as follows:
a.tt
{
color:Black;
text-decoration: none;
border-bottom: 1px dashed Blue;
}
a.tt:visited {
color: Black;
}

a.tt:hover
{
background:#F0F8FF;
color:Black;
cursor:help;
}

But when I run the page, none of the a.tt styles are being displayed. The
strange thing is, when I add a regular html <a> control on the page, it works
fine.
 
that's odd - I just created a page with just the link button, copied from
your code below, and added a stylesheet with your css code - -
It seemed to work just fine - - at least the main class - - since I have no
code for it to go anywhere, I can't verify the 'visited' css


David Wier
http://aspnet101.com
http://iWritePro.com - One click PDF, convert .doc/.rtf/.txt to HTML with no
bloated markup
http://cg.augustwind.com - ControlGrouper (new ASP.Net control) - control
multiple controls at one time.
 
You're right. The code would have worked. I took a look at my aspx code and I
noticed I didn't have a close ">" in the DOCTYPE declaration. It's all good
now.

This is so strange. It's a very big page, with tabs and grids and every
control you can think of, and the only one that didn't work was the link
button....
 
Back
Top