Home › Forums › CSS › On load change css/hyperlink › Re: On load change css/hyperlink
August 25, 2012 at 6:27 pm
#108464
Participant
I usually just give the <body> a class on each page, which is matched on the links. You then have this for example:
HTML
... ...
PHP
CSS
body.home li.home a,
body.contact-us li.contact-us a,
body.about-us li.about-us a {
color: grey;
cursor: default;
font-weight: bold;
}
So this is the most basic way to do it. The only problem is that the hyperlink does not go away (that could be done in JavaScript, but it would be too much work for such a trivial thing), but the cursor pretends there isn’t one there, which’ll dissuade the user from clicking it hopefully. And if they do, well they only reload the page.