Click to See Complete Forum and Search --> : disabled tag - changing default rendering


RedWingsSux
03-10-2004, 06:22 PM
My apologies in advance if this post should go into the CSS area.

When the below code renders in IE the text link is grey and underlined. The grey color is okay but I don't want the underline. Anyone know how to change the default style for disabled to remove the underline?

<html>
<head>
<style>
.link { text-decoration:none; }
</style>
</head>
<body>
<a href="#" class="link" disabled="disabled">Text</a>
</body>
</html>

Additional info. I want to disable an HREF tag when the user is on that page (FYI - my platform is asp.net). My alternative is to assign additional logic to remove the HREF when on that page - but I would rather use disabled.

p.s. Todd Bertuzzi is a sissy!

David Harrison
03-10-2004, 07:12 PM
How about just removing the <a> tag completely and replacing it with:

<span class="link">Text</span>

Then your styles could look like this:

span.link { color:#dfdfdf; }

RedWingsSux
03-10-2004, 09:43 PM
Thanks Lavalamp!

To answer your question, this is for a software application and there may be 10,000 instances of this. Asp.net has built in controls to disable a link when it's active, hence no additional code. So, that's the reason I'm trying to change the default link appearance. Otherwise I will need to use some code that says if active, change class or remove anchor. Normally no big deal but when you compile this code X 10,000, your talking about a lot of extra code and parsing.

p.s. I no longer hate the Red Wings - I hate the Vancouver Canucks. In the history of disquisting people it goes like this: Hitler, Todd Bertuzzi, Bin Laden, the rest of the Canucks hockey team (including Marc Crawford), Canucks fans, Saddam Hussein...

David Harrison
03-11-2004, 12:09 PM
Well there is no actual way to disable a link since the a tag doesn't support a "disabled" attribute, of course, that means it's just an IE thing.

So using a span tag to replace the link is the only way to actually give the impression of a disabled link in all browsers. If you have so many of these links to be "deadened" on one page, perhaps you might want to try splitting it into a number of separate pages.