Kombinationen zw. Pseudoformaten?
Tobias Schmidbauer
- css
Hei, sind (theoretisch) auch Kombinationen
zwischen Pseudo-Formaten möglich?
-z.B.: (Selbstkonstruktion)
a:hover:first-letter {color:blue;}
-oder:
input:focus:before {content:url('pfeil.gif');}
Hallo,
Hei, sind (theoretisch) auch Kombinationen
zwischen Pseudo-Formaten möglich?
Dreimal darfst Du raten, was im Standard steht. ;-)
a:hover:first-letter {color:blue;}
Funktioniert nicht, zumindest nicht im Mozilla 1.2.1, sollte aber erlaubt sein.
input:focus:before {content:url('pfeil.gif');}
Funktioniert im Mozilla, sofern auch input:before definiert ist, sonst nicht. (sollte aber auch so funktionieren) Aber er spinnt mit dem Cursor.
Christian
Hi Christian,
a:hover:first-letter {color:blue;}
Funktioniert nicht, zumindest nicht im Mozilla 1.2.1,
gut so, ist nämlich kehrvert.
input:focus:before {content:url('pfeil.gif');}
Funktioniert im Mozilla, sofern auch input:before definiert ist, sonst nicht. (sollte aber auch so funktionieren) Aber er spinnt mit dem Cursor.
Kombinationen aus Pseudoformaten sind in Mozilla leider allesamt noch etwas wackelig - soferne sich überhaupt etwas tut. :before:hover finde ich übrigens sehr sinnvoll, um Links zu kennzeichnen.
a[hreflang]:before {
content:attr(hreflang)" ";
color:#888;
background-color:inherit;
border:1px dotted #888;
}
a[hreflang]:before:hover {
color:#000;
background-color:#efe;
border-style:solid;
}
Opera macht's :)
LG Roland
Hei, sind (theoretisch) auch Kombinationen
zwischen Pseudo-Formaten möglich?
Dazu musst du erst mal zwischen Pseudoklassen und Pseudoelementen unterscheiden (ist in CSS3 einfacher, da PE einen doppelten Doppelpunkt haben):
| Pseudo-classes are allowed anywhere in selectors while pseudo-
| elements may only appear after the subject of the selector.
a:hover:first-letter {color:blue;}
input:focus:before {content:url('pfeil.gif');}
Das ist also beides nicht erlaubt. Hingegen müsste es andersrum möglich sein:
a::first-letter:hover {color:blue;}
input::before:focus {content:url('pfeil.gif');}
Allerdings ist nun der Sinn ein anderer