|
Just apply an inline style. Cascading Style Sheets are so-called because they cascade.
So if an element has a style applied via a CLASS, but inline (via "style" tag") has the same style applied with a different value, the MOST SPECIFIC style will apply.
The answer then is to keep using classes, but in your various page load events, override the style of a particular link by using the JavaScript "element.style" syntax.
Thomas D. Greer
www.tgreer.com
|
|
|
|
|
<html>
<head>
<style type="text/css">
.lnkBlue { color: #00F;}
</style>
<script type="text/javascript">
function changeLink(x)
{
document.getElementById(x).style.color = "#F00";
}
</script>
</head>
<body onload="changeLink('redLink');">
<a id="blueLink" class="lnkBlue">Blue</a>
<br/>
<a id="redLink" class="lnkBlue">Red</a>
</body>
</html>
|
|
|
|
|
You're welcome. Just a reminder: CodeToad is advertiser-supported, as is www.tgreer.com. There are some CSS articles there, as well.
|
|
|
|
|
|
|
|
|
|