Syom Syom - 8 months ago 37
CSS Question

How to disable a HTML tag?

I want to disable a tag if it's already set -- e.g., disable a menu using

disabled = "true"
or something.

I can remove a tag completely using PHP; but I have already styled it and only want to disable it. Is it possible?


Nope, there is no CSS-only way known to me to disable a link the way you describe.

The only thing that comes to mind is putting an additional, transparent element in front of the link, but that can't be achieved in pure CSS, either.

How about giving it a href='#' onclick='return false' when generating them in PHP?