W3C home > Mailing lists > Public > www-style@w3.org > May 2001

Re: first-word pseudo-element

From: Bjoern Hoehrmann <derhoermi@gmx.net>
Date: Thu, 17 May 2001 23:04:27 +0200
To: "Peter S. Linss" <peter@linss.com>
Cc: Chris Wilson <cwilso@microsoft.com>, www-style@w3.org
Message-ID: <c5b8gtst3usnuvoggg22788il58l365hqh@4ax.com>
* Peter S. Linss wrote:
>> And, in fact, it's somewhat contradictory, because CSS already claims to
>> know what a "word" is, at least in some contexts - due to the
>> 'word-spacing' property.  :^)
>
>Yes, it's an issue that can't simply be ignored for lack of a universal
>definition. Words exist in many languages used on the web, we should be able
>to style them.
>
>> That said, ":first-word" would be a one-off.  I'd be much more
>> interested in a ":first-n-words" and ":first-n-letters".

That should be ::first-words(n) and ::first-letters(n) otherwise it
would be hard to read. I must say, I don't really like this pollution
with selectors. Hm, there are a lot of selectors selecting 'first',
'last' and 'nth' and especially 'child', i.e. [1]

  E:first-child
  E:last-child
  E:only-child
  E:nth-child(expr)
  E:nth-last-child(expr)

  E:nth-last-of-type(expr)
  E:nth-of-type(expr)
  E:first-of-type
  E:last-of-type

So we have 6 methods (remember the child combinator) to select distinct
kinds of children of an element. Is this really necessary? I could live
with

  e:child(first)
  e:child(last)
  e:child(only)
  e:child(even)
  e:child(odd)
  e:child(4n+4)

or

  ...
  e:children(even)
  e:children(odd)
  e:children(4n+4)

if readability is an important issue.

I don't know if it is possible to express nth-last-child with this
nn+/-x-Syntax but I can live without that selector :) :first-child could
be marked deprecated and kept for compatibility reasons.

Another approach would be to express the nth-thing in another way to
have a generic mechanism to select nth-words, nth-lines, nth-children,
nth-etceteras... I have to think about that...

I think it's really important to have a small number of selectors; other
modules like 'User Interface for CSS3' add even more selectors like
::menu. Common CSS authors already have problems to make use of all the
selectors in CSS Level 2 (even with user agent support) and I fear most
selectors won't be used by the majority and I fear that again leads to
implementation problems in Microsofts Internet Explorer for Windows...

[1] the current drafts lists this as 'E:nth-child(n)' etc. in section 2,
    'expr' is much more appropriate

>Agreed. Also first-n-lines.

What does

  elem:not(elem::first-line)::first-line { }

select? Do typographic pseudo-classes and -elements apply to concat'ed
element content or to the context of the current selection?
-- 
Björn Höhrmann { mailto:bjoern@hoehrmann.de } http://www.bjoernsworld.de
am Badedeich 7 } Telefon: +49(0)4667/981028 { http://bjoern.hoehrmann.de
25899 Dagebüll { PGP Pub. KeyID: 0xA4357E78 } http://www.learn.to/quote/
Received on Thursday, 17 May 2001 17:03:11 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:54:09 GMT