Is there any way to disable a link using CSS?
I have a class called current-page
and want links with this class to be disabled so that no action occurs
One way you could do this with CSS, would be to set a CSS on a wrapping div
that you set to disappear and something else takes it's place.
E.g.:
blah
blah
With a CSS like
.disabled a.toggleLink { display: none; }
span.toggleLink { display: none; }
.disabled span.toggleLink { display: inline; }
To actually turn off the a
you'll have to replace it's click event or href
, as described by others.
PS: Just to clarify I'd consider this a fairly untidy solution, and for SEO it's not the best either, but I believe it's the best with purely CSS.