Forum Moderators: not2easy
Is there a possibility to specify the style for pseudo classes inline. In other words, an inline equivalent to
a.linkclass1:focus {
background-color: #3399CC;
}
Thanks in advance,
Stefan
Is there a possibility to specify the style for pseudo classes inline.
There is currently no way to define pseudoclasses inline. (Although there is a Working Draft recommendation at the W3C that, should it ever become a Candidate recommendation, would allow it. This, of course, is not an implementable feature, and since the working draft is three years old, I wouldn't hold out much hope for it's progress, but it's an interesting idea. For more, see DrDoc's discussion of it here [webmasterworld.com], or the Working Draft document [w3.org], itself.)
For now, however, we're limited to pseudoclasses as internal or external CSS. If you really don't want to define the styles in an external stylesheet or in the head of the document, you'll have to fall back on inline javascript mouseovers...
<a href="#" onmouseover="this.style.backgroundColor='red'" onmouseout="this.style.backgroundColor='transparent'">Link Text</a>
cEM