specific css everytime a word appears?

C

chris

Is it possible to automatically assign a specific attribute to a specific
word in a text paragraph with css? Ive found something that assigns css to
some css wich has a specific parameter but not to a text. Also it works only
with netscape.

For e.g. I have the word "elke" (which is the name of a band) appearing very
often over the whole website. I want it bold everytime. Is there a solution
to automatically apply the bold attribute? Or do I have to apply it for
every appearence?

chris---
 
A

altamir

chris said:
Is it possible to automatically assign a specific attribute to a
specific word in a text paragraph with css?
no.

Ive found something that
assigns css to some css wich has a specific parameter but not to a
text. Also it works only with netscape.
For e.g. I have the word "elke" (which is the name of a band)
appearing very often over the whole website. I want it bold everytime.
Is there a solution to automatically apply the bold attribute? Or do I
have to apply it for every appearence?

use search-replace function, which goes with every server-side language
(like php), to replace 'elke' with '<strong>elke</strong>'. if you don't
have an access to server-side scripts you can alternatively use text editor
to do that locally.
 
J

Jukka K. Korpela

chris said:
Is it possible to automatically assign a specific attribute to a
specific word in a text paragraph with css?

No. In HTML, you could define and use an entity, if only browsers had
ever implemented even HTML 2.0. In practice, use a good editor to
perform a global replace - or reconsider what you are doing.
For e.g. I have the word "elke" (which is the name of a band)
appearing very often over the whole website.

Shouldn't it be written as "Elke", if it is a proper name? This might
remove the problem. In other words, you might have created the problem
by using a name in odd spelling. Just stop doing that. (This reminds me
of a recent incident when an insurance company tried to start using
"if..." as its company name. The idea surely looked good on the dee-
sigh-ner's screen.)
I want it bold everytime.

Hardly a good idea, since bolding tends to emphasize global importance,
and if you emphasize the occurrences of a single word that much, you
can't really _emphasize_ anything. And it disrupts reading. In any
case, if you still use bolding, use <b>...</b> and not
<strong>...</strong>, since it's really not a matter of strong emphasis
but style. That way, maybe some people who use a speech synthesizer
will avoid hearing those occurrences in a raised voice.
 
C

chris

Jukka K. Korpela said:
No. In HTML, you could define and use an entity, if only browsers had
ever implemented even HTML 2.0. In practice, use a good editor to
perform a global replace - or reconsider what you are doing.


Shouldn't it be written as "Elke", if it is a proper name? This might
remove the problem. In other words, you might have created the problem
by using a name in odd spelling. Just stop doing that. (This reminds me
of a recent incident when an insurance company tried to start using
"if..." as its company name. The idea surely looked good on the dee-
sigh-ner's screen.)


Hardly a good idea, since bolding tends to emphasize global importance,
and if you emphasize the occurrences of a single word that much, you
can't really _emphasize_ anything. And it disrupts reading. In any
case, if you still use bolding, use <b>...</b> and not
<strong>...</strong>, since it's really not a matter of strong emphasis
but style. That way, maybe some people who use a speech synthesizer
will avoid hearing those occurrences in a raised voice.

Thanks for the help guys. I solved the problem by simply doing a global
replace, but I thought it would be much nicer (and better for later changes)
to do it with css.

To Jukka: The word is actually written "EL*KE". Its the bands name and much
like a logo and theres nothing i can do about it. Also not I but the client
wanted it bold. But i could convince them that this is a 'not so good idea'
:)
However there was another Problem with the name cause some (Mac) browser
broke up the word at the '*' if the word was at the end of the line, making
it look very bad. So I had to put some <nobr> around it.

chris
 
N

Nick Theodorakis

[...]
To Jukka: The word is actually written "EL*KE". Its the bands name and much
like a logo and theres nothing i can do about it. Also not I but the client
wanted it bold. But i could convince them that this is a 'not so good idea'
:)
However there was another Problem with the name cause some (Mac) browser
broke up the word at the '*' if the word was at the end of the line, making
it look very bad. So I had to put some <nobr> around it.

In that case, if you are using <nobr> only to mark up the band's
name, how about just styling the <nobr> as bold in your css file?

Nick
 
J

Jukka K. Korpela

Under Subject: Re: specific css everytime a word appears?
chris said:
The word is actually written "EL*KE". - -
However there was another Problem with the name cause some (Mac)
browser broke up the word at the '*' if the word was at the end of
the line, making it look very bad.

That's very strange. What browser might that be?

I'm actually not surprised at hearing that browsers break lines that
oddly. But it's particularly odd, because the asterisk belongs to line
breaking class ( http://www.cs.tut.fi/~jkorpela/unicode/linebr.html )
AL, which means 'alphabetic', so EL*KE should be treated in line
breaking as if the asterisk were a letter.
So I had to put some <nobr> around it.

Yes, that's the practical solution.
 

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
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top