- From: Ian Hickson <exxieh@bath.ac.uk>
- Date: Tue, 24 Feb 1998 20:34:54 -0000
- To: www-style@w3.org
Hi guys, [I] just noticed an error in the current CSS2 working draft (1). In section 5.10 on pseudo-elements and pseudo-classes, it says "only one pseudo-element can be specified per selector" (2). However, a bit lower down in section 5.10.3 there is a statement which starts "When the :first-letter and :first-line pseudo-elements are combined with :before and :after, ..." (3). Surely these two statements are in conflict? [W]hat is the reasoning behind the first statement? Consider the following (technically illegal) code: P:first-letter:before { content: "[" } P:first-letter:after { content: "]" } [T]his could surely come in useful, but is not currently allowed if we follow section 5.10. I presume, if it was allowed, that it should simply insert square brackets around the first letter. The selector "P:before:first-letter" might be more even useful, if it applies to the first-letter of the inserted content. Where does the last paragraph of 5.10.3 stand on this? It doesn't seem very clear as to what important the order of the pseudo-elements would have. [(A]nd, by extension, "P:before:first-letter:after" - a pseudo-element which is inserted just after the first letter of the inserted text which comes before the content of every paragraph!) On a related note, look at the following rule P EM, P:first-line { font-style: italic; } and imagine what would happen to the following text: <P>This is <EM>the</EM> first line of text.</P> The emphasised "the" would not be emphasised! What we need is P:first-line EM { font-style: normal; } but according to the last line of the selectors page (4) it is wrong, because "Pseudo-elements must be specified at the end of a selector". Again, I don't really understand the reasoning in this. APPENDIX: BIBLIOGRAPHY (1) http://www.w3.org/TR/1998/WD-css2-19980128/ (2) last paragraph of http://www.w3.org/TR/1998/WD-css2-19980128/selector.html#pseudo-elements (3) last paragraph of http://www.w3.org/TR/1998/WD-css2-19980128/selector.html#h-5.10.3 (4) last paragraph of http://www.w3.org/TR/1998/WD-css2-19980128/selector.html#h-5.10.6 I should say, for those that will wonder, that the selectors page is my favourite section of the current working draft. Now if only anyone supported them... -- Ian Hickson -----BEGIN GEEK CODE BLOCK----- Version: 3.12 GIT/M/S d- s+: a--- C++(+++)>$ U P L+ !E W++ N++ o? K? w++>+++ O- !M V- PS+ PE- Y+ PGP t 5+++>++++ X- R+++ tv b++(+++) DI D++ G e-(*)>+++++ h!()(--) y? ------END GEEK CODE BLOCK------
Received on Tuesday, 24 February 1998 15:37:26 UTC