one simple question

Discussion in 'HTML' started by Leo Baumann, Dec 4, 2004.

  1. Leo Baumann

    Leo Baumann Guest

    hello,

    how can i change the color of one word in a standart html-text ?

    thanks ...

    mfg Leo
     
    Leo Baumann, Dec 4, 2004
    #1
    1. Advertising

  2. Leo Baumann

    Dylan Parry Guest

    Leo Baumann wrote:

    > how can i change the color of one word in a standart html-text ?


    This word is <span style="color:#ff0000;">red</span>.

    The code is simply a standard hex code that you can get in most image
    editing software, or from several charts available online --- see:
    <URL:http://webpageworkshop.co.uk/main/color_codes> for a table of them.

    --
    Dylan Parry
    http://webpageworkshop.co.uk -- FREE Web tutorials and references
     
    Dylan Parry, Dec 4, 2004
    #2
    1. Advertising

  3. Please state a subject in the subject field of your post. 'one simple
    question' is not the subject. It is 'changing color of one word'

    On Sat, 4 Dec 2004 14:50:14 +0100, Leo Baumann <>
    wrote:

    > how can i change the color of one word in a standart html-text ?
    >


    What is a standard html-text? HTML is Hyper Text Markup Language. One
    marks up content with semantic tags, elements. I recon you mean text in a
    paragraph, but then my glass ball might be a bit damp.

    What is the reason you want one word to change color? Isn't it confusing
    if that one word that jumps out doesn't do anything, like being a link or
    having a specific title? If it is just a dfferent color it might confuse
    your visitor.

    Having said all that, here is a way to do what you want:

    Firstly, think of the reason you want a word to stand out in your text,
    for example because it is jargon and you want to assist visitors in
    understanding it. From the reason think of a proper name for a class,
    because that is what you will be using. For jargon, .jargon might be a
    useful class name. Then make the class and define the styles you want it
    to have and make sure they are different from the styles applied to your
    hyperlinks.

    html in the body of your page:
    <p>If one is about to use <abbr class="jargon" title="Hyper Text Markup
    Language">HTML</abbr> and style it too, one could go to <a
    href="http://www.w3schools.org/html/default.asp">W3C's html course</a> to
    learn proper markup and to <a
    href="http://www.w3schools.org/css/default.asp">W3C's CSS course</a> to
    learn about styling.</p>

    css in the head of your page:
    <style type="text/css">

    ..jargon {
    color:teal;
    border-bottom:1px dotted teal;
    cursor:help; }

    </style>

    Hope this helps.

    --
    Weblog | <http://home.wanadoo.nl/b.de.zoete/_private/weblog.html>
    Webontwerp | <http://home.wanadoo.nl/b.de.zoete/html/webontwerp.html>
    Zweefvliegen | <http://home.wanadoo.nl/b.de.zoete/html/vliegen.html>
     
    Barbara de Zoete, Dec 4, 2004
    #3
  4. Leo Baumann

    Liz Guest

    In message <opsihlunqkx5vgts@zoete_b>
    "Barbara de Zoete" <> wrote:


    > Firstly, think of the reason you want a word to stand out in your text,
    > for example because it is jargon and you want to assist visitors in
    > understanding it. From the reason think of a proper name for a class,
    > because that is what you will be using. For jargon, .jargon might be a
    > useful class name. Then make the class and define the styles you want it
    > to have and make sure they are different from the styles applied to your
    > hyperlinks.
    >
    > html in the body of your page:
    > <p>If one is about to use <abbr class="jargon" title="Hyper Text Markup
    > Language">HTML</abbr> and style it too, one could go to <a
    > href="http://www.w3schools.org/html/default.asp">W3C's html course</a> to
    > learn proper markup and to <a
    > href="http://www.w3schools.org/css/default.asp">W3C's CSS course</a> to
    > learn about styling.</p>
    >
    > css in the head of your page:
    > <style type="text/css">
    >
    > .jargon {
    > color:teal;
    > border-bottom:1px dotted teal;
    > cursor:help; }
    >
    > </style>
    >
    > Hope this helps.
    >

    <heresy>
    If you think that's using a sledgehammer to crack a nut, and you don't
    mind about being deprecated (have to validate transitional), you can just
    use <font color:#ffcc33>word</font>.
    </heresy>
    :)

    Slainte

    Liz

    --
    Virtual Liz now at http://www.v-liz.com
    Kenya; Tanzania; Namibia; India; Seychelles; Galapagos
    "I speak of Africa and golden joys"
     
    Liz, Dec 4, 2004
    #4
  5. Leo Baumann

    Dylan Parry Guest

    Liz wrote:

    > <font color:#ffcc33>word</font>.


    But then that wouldn't validate even if you were to use a transitional
    document type ;)

    --
    Dylan Parry
    http://webpageworkshop.co.uk -- FREE Web tutorials and references
     
    Dylan Parry, Dec 4, 2004
    #5
  6. Leo Baumann

    Steve Pugh Guest

    On Sat, 04 Dec 2004 15:14:37 +0100, "Barbara de Zoete"
    <> wrote:

    ><p>If one is about to use <abbr class="jargon" title="Hyper Text Markup
    >Language">HTML</abbr> and style it too, one could go to <a
    >href="http://www.w3schools.org/html/default.asp">W3C's html course</a> to
    >learn proper markup and to <a
    >href="http://www.w3schools.org/css/default.asp">W3C's CSS course</a> to
    >learn about styling.</p>


    w3schools.org is not the W3C.

    Steve
     
    Steve Pugh, Dec 4, 2004
    #6
  7. Leo Baumann

    Leo Baumann Guest

    Leo Baumann, Dec 4, 2004
    #7
  8. On Sat, 04 Dec 2004 14:44:08 GMT, Liz <> wrote:

    > In message <opsihlunqkx5vgts@zoete_b>
    > "Barbara de Zoete" <> wrote:
    >
    >
    >> Firstly, think of the reason you want a word to stand out in your text,
    >> for example because it is jargon and you want to assist visitors in
    >> understanding it. From the reason think of a proper name for a class,
    >> because that is what you will be using. For jargon, .jargon might be a
    >> useful class name. Then make the class and define the styles you want it
    >> to have and make sure they are different from the styles applied to your
    >> hyperlinks.
    >>
    >> html in the body of your page:
    >> <p>If one is about to use <abbr class="jargon" title="Hyper Text Markup
    >> Language">HTML</abbr> and style it too, one could go to <a
    >> href="http://www.w3schools.org/html/default.asp">W3C's html course</a>
    >> to
    >> learn proper markup and to <a
    >> href="http://www.w3schools.org/css/default.asp">W3C's CSS course</a> to
    >> learn about styling.</p>
    >>
    >> css in the head of your page:
    >> <style type="text/css">
    >>
    >> .jargon {
    >> color:teal;
    >> border-bottom:1px dotted teal;
    >> cursor:help; }
    >>
    >> </style>
    >>
    >> Hope this helps.
    >>

    > <heresy>
    > If you think that's using a sledgehammer to crack a nut, and you don't
    > mind about being deprecated (have to validate transitional), you can just
    > use <font color:#ffcc33>word</font>.
    > </heresy>
    > :)
    >


    Yes. As I stated I gave *a* way to do it. Judging from his question (how
    to change color of a word) the OP is not really very competent with html
    or css yet. I based my response on that judgement (for all I know, I might
    be completely wrong), and tried not only to solve a simple 'problem' but
    give a learning opportunity as well. With that I take no shortcuts. Learn
    the proper way, learn the cheats later when you know what you are doing
    wrong on purpose, why you are doing things wrong on purpose and what the
    effect might be for doing it wrong on purpose.


    --
    Weblog | <http://home.wanadoo.nl/b.de.zoete/_private/weblog.html>
    Webontwerp | <http://home.wanadoo.nl/b.de.zoete/html/webontwerp.html>
    Zweefvliegen | <http://home.wanadoo.nl/b.de.zoete/html/vliegen.html>
     
    Barbara de Zoete, Dec 4, 2004
    #8
  9. In article <>, invalid@v-
    liz.co.uk says...
    > In message <opsihlunqkx5vgts@zoete_b>
    > "Barbara de Zoete" <> wrote:
    >
    >
    > > Firstly, think of the reason you want a word to stand out in your text,
    > > for example because it is jargon and you want to assist visitors in
    > > understanding it. From the reason think of a proper name for a class,
    > > because that is what you will be using. For jargon, .jargon might be a
    > > useful class name. Then make the class and define the styles you want it
    > > to have and make sure they are different from the styles applied to your
    > > hyperlinks.
    > >
    > > html in the body of your page:
    > > <p>If one is about to use <abbr class="jargon" title="Hyper Text Markup
    > > Language">HTML</abbr> and style it too, one could go to <a
    > > href="http://www.w3schools.org/html/default.asp">W3C's html course</a> to
    > > learn proper markup and to <a
    > > href="http://www.w3schools.org/css/default.asp">W3C's CSS course</a> to
    > > learn about styling.</p>
    > >
    > > css in the head of your page:
    > > <style type="text/css">
    > >
    > > .jargon {
    > > color:teal;
    > > border-bottom:1px dotted teal;
    > > cursor:help; }
    > >
    > > </style>
    > >
    > > Hope this helps.
    > >

    > <heresy>
    > If you think that's using a sledgehammer to crack a nut, and you don't
    > mind about being deprecated (have to validate transitional), you can just
    > use <font color:#ffcc33>word</font>.
    > </heresy>
    > :)


    No you can't.

    --
    Hywel http://kibo.org.uk/
    I do not eat quiche.
     
    Hywel Jenkins, Dec 4, 2004
    #9
  10. On Sat, 04 Dec 2004 14:57:40 +0000, Steve Pugh <> wrote:

    > On Sat, 04 Dec 2004 15:14:37 +0100, "Barbara de Zoete"
    > <> wrote:
    >
    >> <p>If one is about to use <abbr class="jargon" title="Hyper Text Markup
    >> Language">HTML</abbr> and style it too, one could go to <a
    >> href="http://www.w3schools.org/html/default.asp">W3C's html course</a>
    >> to
    >> learn proper markup and to <a
    >> href="http://www.w3schools.org/css/default.asp">W3C's CSS course</a> to
    >> learn about styling.</p>

    >
    > w3schools.org is not the W3C.
    >


    Thanks Steve. I never realised that. I keep learning something new every
    day, sometimes even twice a day :)


    --
    Weblog | <http://home.wanadoo.nl/b.de.zoete/_private/weblog.html>
    Webontwerp | <http://home.wanadoo.nl/b.de.zoete/html/webontwerp.html>
    Zweefvliegen | <http://home.wanadoo.nl/b.de.zoete/html/vliegen.html>
     
    Barbara de Zoete, Dec 4, 2004
    #10
  11. On Sat, 4 Dec 2004 15:58:13 +0100, Leo Baumann <>
    wrote:

    > thank You very much, that was it ....
    >


    Dylan, see what you did? You spoiled him out of his chance to learn
    something. :-(

    <http://www.amatecon.com/fish.html>


    --
    Weblog | <http://home.wanadoo.nl/b.de.zoete/_private/weblog.html>
    Webontwerp | <http://home.wanadoo.nl/b.de.zoete/html/webontwerp.html>
    Zweefvliegen | <http://home.wanadoo.nl/b.de.zoete/html/vliegen.html>
     
    Barbara de Zoete, Dec 4, 2004
    #11
  12. Leo Baumann

    Dylan Parry Guest

    Barbara de Zoete wrote:

    > Dylan, see what you did? You spoiled him out of his chance to learn
    > something. :-(


    Not so. He learned how to change the color of words using HTML/CSS. He
    asked a direct question, so I gave a direct answer.

    It really gets on my whick when people insist on answering something
    with "blah blah Google blah blah" or with the most vague of answers that
    still require the OP to go off and spend hours reading up on something.
    In your case it was the suggestion of a sledgehammer when the OP
    requested a toffee hammer :)

    You also gave him a misleading answer as yours was specific to the case
    of changing the color of an abbreviation, whereas the OP asked about the
    generic situation of change "a word" as in *any* word.

    --
    Dylan Parry
    http://webpageworkshop.co.uk -- FREE Web tutorials and references
     
    Dylan Parry, Dec 4, 2004
    #12
  13. On Sat, 04 Dec 2004 15:29:40 +0000, Dylan Parry <>
    wrote:

    > Barbara de Zoete wrote:
    >
    >> Dylan, see what you did? You spoiled him out of his chance to learn
    >> something. :-(

    >
    > Not so. He learned how to change the color of words using HTML/CSS. He
    > asked a direct question, so I gave a direct answer.
    >
    > It really gets on my whick when people insist on answering something
    > with "blah blah Google blah blah" or with the most vague of answers that
    > still require the OP to go off and spend hours reading up on something.
    > In your case it was the suggestion of a sledgehammer when the OP
    > requested a toffee hammer :)
    >
    > You also gave him a misleading answer as yours was specific to the case
    > of changing the color of an abbreviation, whereas the OP asked about the
    > generic situation of change "a word" as in *any* word.
    >


    Well, we just disagree. I wonder what OP's next question is. 'How do I
    remove the line under a link?'

    --
    Weblog | <http://home.wanadoo.nl/b.de.zoete/_private/weblog.html>
    Webontwerp | <http://home.wanadoo.nl/b.de.zoete/html/webontwerp.html>
    Zweefvliegen | <http://home.wanadoo.nl/b.de.zoete/html/vliegen.html>
     
    Barbara de Zoete, Dec 4, 2004
    #13
  14. Leo Baumann

    Dylan Parry Guest

    Barbara de Zoete wrote:

    > Well, we just disagree.


    That's okay. Can you imagine how awful the world would be if everyone
    agreed with each other and we all got along? :D

    > I wonder what OP's next question is. 'How do I
    > remove the line under a link?'


    Heh :) Depends on how much of a newbie he really is... that is a bit
    advanced! I would expect a true newbie to say "I have a page with three
    frames, and one has a table in it containing all my animated gifs. How
    can I make the bottom frame refresh using just HTML? Also how can I make
    it so that the visitors can't change the font size, cos when they do my
    page looks ugly and the tables get broken?"

    --
    Dylan Parry
    http://webpageworkshop.co.uk -- FREE Web tutorials and references
     
    Dylan Parry, Dec 4, 2004
    #14
  15. On Sat, 04 Dec 2004 16:00:59 +0000, Dylan Parry <>
    wrote:

    > Barbara de Zoete wrote:
    >
    >> Well, we just disagree.

    >
    > That's okay. Can you imagine how awful the world would be if everyone
    > agreed with each other and we all got along? :D
    >


    Well, I think one can disagree firmly but get along fine and that is the
    way I prefer it to be.

    >> I wonder what OP's next question is. 'How do I remove the line under a
    >> link?'

    >
    > Heh :) Depends on how much of a newbie he really is... that is a bit
    > advanced! I would expect a true newbie to say "I have a page with three
    > frames, and one has a table in it containing all my animated gifs. How
    > can I make the bottom frame refresh using just HTML? Also how can I make
    > it so that the visitors can't change the font size, cos when they do my
    > page looks ugly and the tables get broken?"
    >


    LOL

    --
    Weblog | <http://home.wanadoo.nl/b.de.zoete/_private/weblog.html>
    Webontwerp | <http://home.wanadoo.nl/b.de.zoete/html/webontwerp.html>
    Zweefvliegen | <http://home.wanadoo.nl/b.de.zoete/html/vliegen.html>
     
    Barbara de Zoete, Dec 4, 2004
    #15
  16. Leo Baumann

    Neal Guest

    On Sat, 4 Dec 2004 14:50:14 +0100, Leo Baumann <>
    wrote:

    > hello,
    >
    > how can i change the color of one word in a standart html-text ?


    Is it merely decorative? Use the span element as others have described.

    Is it for emphasis, does it imply stress on the word? Use the em element.
    Possible stylesheet:

    em.foo {
    color: #ff0000;
    font-style: none;
    }

    <p>This word is <em class="foo">emphasized</em> with color. In a no-CSS
    browser it will be done in some other way. Replace "foo" with whatever
    makes more sence, considering the purpose of this coloring.</p>

    (Note - the first declaration sets the color. The second undoes the
    automatic italicization of the em element.)

    If you do it with span, then no-CSS environments will do nothing. With the
    em, it should do something, if not what you want. So in either case, do
    not ask people to "look at the red word" because it might not be red for
    them.
     
    Neal, Dec 4, 2004
    #16
  17. Leo Baumann

    Leo Baumann Guest

    i remove the lines under links within explorers extras ... :),
    i've seen it somewher ....

    best regards Leo
     
    Leo Baumann, Dec 4, 2004
    #17
  18. Leo Baumann

    Leo Baumann Guest

    Leo Baumann, Dec 4, 2004
    #18
  19. Leo Baumann

    Neal Guest

    On Sat, 4 Dec 2004 20:05:12 +0100, Leo Baumann <>
    wrote:

    > oh dear,
    > dear friends,
    >
    > i only wanted to colorize some words at this side ...
    >
    > http://web1144.server19.greatnet.de/usaberech.htm#Rosh


    Yay, a URL! Wheeeee!

    Now, which words do you want to color, and why?
     
    Neal, Dec 4, 2004
    #19
  20. Leo Baumann

    Neal Guest

    Neal:
    > Leo Baumann:
    >> http://web1144.server19.greatnet.de/usaberech.htm#Rosh


    BTW, not related to your color question:

    <a name="#Rosh">

    This is incorrect, the # should not be here. It should only be in your
    href leading to here. Because of this, I didn't see that you were trying
    to direct me to this section, because it failed in my browser (as it
    should in a conforming browser).

    BTW, 93 validator errors assuming a transitional doctype. Your HTML
    generating software is rather poor, I'm afraid.
     
    Neal, Dec 4, 2004
    #20
    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. Replies:
    0
    Views:
    559
  2. Patrick Maddox
    Replies:
    0
    Views:
    991
    Patrick Maddox
    Aug 1, 2003
  3. news.frontiernet.net
    Replies:
    6
    Views:
    1,125
    news.frontiernet.net
    Apr 16, 2004
  4. loveNUNO
    Replies:
    2
    Views:
    924
    loveNUNO
    Nov 20, 2003
  5. Merciadri Luca
    Replies:
    4
    Views:
    818
Loading...

Share This Page