From: Karsten Wutzke on
Hello,

does CSS have a selector that allows the selection of content? I want
to syntax highlight specific keywords in my pre and code tags, ideally
operators, numerics, strings, and comments, too.

The "classic" CSS only way to do so seems to be to use spans all over
the place. But, this can become very unhandy at some point. The text
is very hard to read from the HTML code.

Is there such a selector? Am I basically stuck to use spans? Note, I
don't want to use JavaScript or any other techniques, just plain HTML/
CSS.

Karsten
From: dorayme on
In article
<ef01ebd2-06c5-43ff-9b4c-18e7cdef3f25(a)u41g2000yqe.googlegroups.co
m>,
Karsten Wutzke <kwutzke(a)web.de> wrote:

> does CSS have a selector that allows the selection of content? I want
> to syntax highlight specific keywords in my pre and code tags, ideally
> operators, numerics, strings, and comments, too.

No.

--
dorayme
From: Karsten Wutzke on
On 4 Feb., 23:37, dorayme <doraymeRidT...(a)optusnet.com.au> wrote:
> In article
> <ef01ebd2-06c5-43ff-9b4c-18e7cdef3...(a)u41g2000yqe.googlegroups.co
> m>,
>  Karsten Wutzke <kwut...(a)web.de> wrote:
>
> > does CSS have a selector that allows the selection of content? I want
> > to syntax highlight specific keywords in my pre and code tags, ideally
> > operators, numerics, strings, and comments, too.
>
> No.
>
> --
> dorayme

:-) I love concise answers.

So using spans is the only pure HTML/CSS way to go?

Thanks
Karsten
From: Nik Coughlin on
On 5/02/2010 12:49 pm, Karsten Wutzke wrote:
> On 4 Feb., 23:37, dorayme<doraymeRidT...(a)optusnet.com.au> wrote:
>> In article
>> <ef01ebd2-06c5-43ff-9b4c-18e7cdef3...(a)u41g2000yqe.googlegroups.co
>> m>,
>> Karsten Wutzke<kwut...(a)web.de> wrote:
>>
>>> does CSS have a selector that allows the selection of content? I want
>>> to syntax highlight specific keywords in my pre and code tags, ideally
>>> operators, numerics, strings, and comments, too.
>>
>> No.
>
> :-) I love concise answers.
>
> So using spans is the only pure HTML/CSS way to go?

Yes.
From: Johannes Koch on
Nik Coughlin schrieb:
> On 5/02/2010 12:49 pm, Karsten Wutzke wrote:
>> So using spans is the only pure HTML/CSS way to go?
>
> Yes.

Or use another element type if there is a more appropriate one.

--
Johannes Koch
In te domine speravi; non confundar in aeternum.
(Te Deum, 4th cent.)