html - Inline CSS Pseudo-classes -
i have thought cannot add in-line :hover{..} styles element, came across this page not long ago, see stuff this.
<a href="http://www.w3.org/" style="{color: #900} :link {background: #ff0} :visited {background: #fff} :hover {outline: thin red solid} :active {background: #00f}">...</a> i don't in-line styles @ all, current app based on in-line styles/scripts so, excellent feature me.
there 1 problem: it doesn't work.
does know why doesn't work? did chrome not implement or something?
demo
demo code w3.org
as matter of fact, the same document referenced in question here. had it:
that document link 10-year-old draft.
it's 11 years old now, that's not point (although suggest reason why example give doesn't work). point example given not appear in latest revision of same specification. so, supposedly, embedding selectors in style attributes deemed not viable , dropped result.
my answer the question linked in comments suggests why such feature deemed not viable — it's not compatible current state of css language:
note inline styles participate in same cascade selectors in rule sets, , take highest precedence in cascade (
!importantnotwithstanding). take precedence on pseudo-class states. allowing pseudo-classes or other selectors in inline styles possibly introduce new cascade level, , new set of complications.
of course, don't claim speak people made decisions and/or wrote spec, if 1 of them, that's reason have given not supporting feature.
that explain why no browser has implemented such feature (or, more likely, lack of implementation among factors causing reconsidered , dropped, giving vendors more of reason not start implementing spec has reached cr status).
the lesson here never cite old revisions of w3c technical documents canon. remember review latest specification; should able find link in header of document.
Comments
Post a Comment