[thelist] How to control the look of anchors with disabled=disabled attribute?

Christian Heilmann codepo8 at gmail.com
Fri Dec 2 02:30:27 CST 2005

> I am using ASP.Net Webcontrol to emit some HTML. The control is either a
> HyperLink or LinkButton.  When I disable the control (by setting the
> controlls Enabled property) the following example HTML is emitted:
> <a id="MainNavBar1_mnuUserReports3" disabled="disabled"  class="navbigger
> yel bold">Reports</a>

> IE shows the Reports as a greyed out link.  I would like some control over
> the color, size, font.  No matter what style I give it, it seems to always
> show up in IE as greyed out.   FireFox does honor stylesheet class
> declarations.  So. how do I set the look of  anchors that have
> "disabled=disabled" attribute?

You can't as it is the visitors' decision to style that link in their
User Agent / Operating System preferences.

An element that doesn't point anywhere or act as a page anchor is not
an A element. If you replace it with a span or simply remove the link
you can style it any way you want to.

Chris Heilmann
Blog: http://www.wait-till-i.com
Writing: http://icant.co.uk/
Binaries: http://www.onlinetools.org/

More information about the thelist mailing list