CSS: Rewriting element declarations
There is a common link declaration
For some links I have to rewrite link declarations. For example, I have to change colors, font-weight, and text-decoration for some link. It's not obvious task, and I spent 30-40 minutes on Internet looking for some ideas. One of the idea was to use on MouseOver and OnMouseOut events which does not work if link is visited. I continued my search and found some excellent idea. The idea was posted on stackoverflow.com by the owner of the site rexmorgan.net Here is his suggestion:
"Inline styles only have rules; the selector is implicit to be the current element.
The selector is an expressive language that describes a set of criteria to match elements in an XML-like document.
However, you can get close, because a style set can technically go most anywhere:
So, following his advice, I added unique id to my link:
<a href="../../../test.aspx" class="topLink" accesskey="0" id="js2" title="Go to Test page">Help</a>
And added some code in CSS:
Now my link looks and behaves differently than all links on my website.