can CSS do this?

P

philiptdotcom

Hi, folks! I'm a newbie to the group, and to CSS.

Can one create a CSS tag--e.g. <definition/>--that can render this:

<definition>affray</definition>

....as this:

<b>affray</b> [&nbsp;<a
href="http://en.wiktionary.org/wiki/affray">Wiktionary</a>&nbsp;]&nbsp;
&nbsp;[&nbsp;<a
href="http://www.google.com/search?q=define:affray">Google&nbsp;define:</a>&nbsp;]

Note that the text surrounded by the tag--"affray"--is repeated three
times within the proposed output, surrounded by other tags and/or
literals. In essence, converting:

A$

....to:

'<b>' + A$ + '</b> [&nbsp;<a href="http://en.wiktionary.org/wiki/' + A$
+ '">Wiktionary</a>&nbsp;]&nbsp; &nbsp;[&nbsp;<a
href="http://www.google.com/search?q=define:' + A$ +
'">Google&nbsp;define:</a>&nbsp;]'

Certainly, it can be done using XML transformations; but can it be done
just using CSS? (If so, how?)

Thanks!!
 
N

Nik Coughlin

philiptdotcom said:
Hi, folks! I'm a newbie to the group, and to CSS.

Can one create a CSS tag--e.g. <definition/>--that can render this:

<definition>affray</definition>

...as this:

<b>affray</b> [&nbsp;<a
href="http://en.wiktionary.org/wiki/affray">Wiktionary</a>&nbsp;]&nbsp;
&nbsp;[&nbsp;<a
href="http://www.google.com/search?q=define:affray">Google&nbsp;define:</a>&nbsp;]

Note that the text surrounded by the tag--"affray"--is repeated three
times within the proposed output, surrounded by other tags and/or
literals. In essence, converting:

A$

...to:

'<b>' + A$ + '</b> [&nbsp;<a href="http://en.wiktionary.org/wiki/' +
A$ + '">Wiktionary</a>&nbsp;]&nbsp; &nbsp;[&nbsp;<a
href="http://www.google.com/search?q=define:' + A$ +
'">Google&nbsp;define:</a>&nbsp;]'

Certainly, it can be done using XML transformations; but can it be
done just using CSS? (If so, how?)

No, you misunderstand the purpose of CSS. All it is intended to be able to
do is select elements in a document and define their properties.
 
A

Andy Dingley

philiptdotcom said:
Can one create a CSS tag--e.g. <definition/>--that can render this:

<definition>affray</definition>

...as this:

<b>affray</b> [&nbsp;<a
href="http://en.wiktionary.org/wiki/affray">Wiktionary</a>&nbsp;]&nbsp;
&nbsp;[&nbsp;<a
href="http://www.google.com/search?q=define:affray">Google&nbsp;define:</a>&nbsp;]


No. That's a content transformation, so do it with XSLT.


Actually you _can_ do it with CSS, using some bizarre proprietary CSS
extension that some fool at either Opera or Mozilla invented. But that
was a terrible idea, so don't use it.
 
H

Harlan Messinger

philiptdotcom said:
Hi, folks! I'm a newbie to the group, and to CSS.

Can one create a CSS tag--e.g. <definition/>--that can render this:

CSS doesn't have tags.
<definition>affray</definition>

Assuming you're talking about an (X)HMTL document, you can't make up
your own HTML tags.
...as this:

<b>affray</b> [&nbsp;<a
href="http://en.wiktionary.org/wiki/affray">Wiktionary</a>&nbsp;]&nbsp;
&nbsp;[&nbsp;<a
href="http://www.google.com/search?q=define:affray">Google&nbsp;define:</a>&nbsp;]

Note that the text surrounded by the tag--"affray"--is repeated three
times within the proposed output, surrounded by other tags and/or
literals. In essence, converting:

A$

...to:

'<b>' + A$ + '</b> [&nbsp;<a href="http://en.wiktionary.org/wiki/' + A$
+ '">Wiktionary</a>&nbsp;]&nbsp; &nbsp;[&nbsp;<a
href="http://www.google.com/search?q=define:' + A$ +
'">Google&nbsp;define:</a>&nbsp;]'

Certainly, it can be done using XML transformations; but can it be done
just using CSS? (If so, how?)

No.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,430
Messages
2,571,676
Members
48,796
Latest member
Greg L.

Latest Threads

Top