specific css everytime a word appears?

Discussion in 'HTML' started by chris, Feb 14, 2004.

  1. chris

    chris Guest

    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---
    chris, Feb 14, 2004
    #1
    1. Advertising

  2. chris

    altamir Guest

    "chris" <> wrote in news:c0jp6d$oj9$01$-online.com:

    > 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.

    --
    altamir
    altamir, Feb 14, 2004
    #2
    1. Advertising

  3. "chris" <> wrote:

    > 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.

    --
    Yucca, http://www.cs.tut.fi/~jkorpela/
    Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html
    Jukka K. Korpela, Feb 15, 2004
    #3
  4. chris

    chris Guest

    "Jukka K. Korpela" <> schrieb im Newsbeitrag
    news:Xns9490E37775011jkorpelacstutfi@193.229.0.31...
    > "chris" <> wrote:
    >
    > > 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.
    >
    > --
    > Yucca, http://www.cs.tut.fi/~jkorpela/
    > Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html
    >


    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
    chris, Feb 16, 2004
    #4
  5. On Mon, 16 Feb 2004 01:23:36 +0100, "chris" <> wrote:


    [...]

    >
    >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

    --
    Nick Theodorakis

    nicholas_theodorakis [at] urmc [dot] rochester [dot] edu
    Nick Theodorakis, Feb 16, 2004
    #5
  6. Browser breaking line after "*"

    Under Subject: Re: specific css everytime a word appears?
    "chris" <> wrote:

    > 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.

    --
    Yucca, http://www.cs.tut.fi/~jkorpela/
    Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html
    Jukka K. Korpela, Feb 16, 2004
    #6
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. alanb
    Replies:
    2
    Views:
    517
    alanb
    Apr 23, 2004
  2. =?Utf-8?B?V2ViTWF0cml4?=

    Is server cache reloaded everytime when web.config changes?

    =?Utf-8?B?V2ViTWF0cml4?=, Jan 27, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    403
    =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
    Jan 27, 2006
  3. David Lozzi

    Build everytime in VS 2005

    David Lozzi, Jul 17, 2006, in forum: ASP .Net
    Replies:
    2
    Views:
    339
    David Lozzi
    Jul 18, 2006
  4. Replies:
    2
    Views:
    1,460
  5. John Harrison

    everytime I read this it make me mad

    John Harrison, Jan 24, 2007, in forum: C++
    Replies:
    7
    Views:
    284
    John Harrison
    Jan 24, 2007
Loading...

Share This Page