Re: first-word pseudo-element

Sean B. Palmer wrote sans explanation:-

> You might consider a "to-content" selector then, where it
> applies style until the first occurance of a certain character,
> or set of characters (non inclusive). "First word" would be
> like :to-content(" ") or whatever.

I'd better explain this a little based on examples already posted to
the list...

The intention was to say that "there is some content in a particular
langauge or class of stuff that should be styled appropriately,
because of these semantics". What, for example Chris Manall, did with
this was O.K. because the semantics of his "<balance>" element demand
that (especially if used in conjunction with, say, and XSD datatype),
but it will lead to gross hacking to other implementors who do not
understand the principle, IMO. The whole point is that CSS should be
on a per language semantics basis, rather than per instance.

In other words, the :to-content(" ") example should be used in
conjunction with a langauge selector, e.g.:-

   p[lang='en']:to-content(" ") { font-weight: bold; }

Using it on any old content would stupid when you take into
consideration the intended semantics of the effect, which is to style
the first word (i.e. the first character block not including " ") in a
piece of markup.

Kindest Regards,
Sean B. Palmer
@prefix : <> .
:Sean :hasHomepage <> .

Received on Thursday, 17 May 2001 11:45:02 UTC