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, Feb 14, 2004
    1. Advertisements

  2. chris

    altamir Guest

    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, Feb 14, 2004
    1. Advertisements

  3. 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.
    Jukka K. Korpela, Feb 15, 2004
  4. chris

    chris Guest

    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, Feb 16, 2004
  5. [...]
    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 Theodorakis, Feb 16, 2004
  6. Under Subject: Re: specific css everytime a word appears?
    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.
    Yes, that's the practical solution.
    Jukka K. Korpela, Feb 16, 2004
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.