How to change colors in text using css?

Discussion in 'HTML' started by not_bad, Sep 30, 2007.

  1. not_bad

    not_bad Guest

    Let's say I need somethink like that below.


    Especially with h3 or bold. How can I change colors?

    Sometimes I need just one letter in different color!

    Google doesn't help a lot.

    Help!


    TIA


    <html>

    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    <title>New Page 1</title>
    </head>

    <body>

    <h3>Lorem<font color="#00FF00"> </font><font
    color="#FF00FF">ipsum</font><font color="#00FF00">
    </font>dolor <font color="#FF0000">sit</font>
    amet, <font color="#0000FF">consectetur </font>adipisicing elit, </h3>

    </body>

    </html>
     
    not_bad, Sep 30, 2007
    #1
    1. Advertising

  2. Gazing into my crystal ball I observed not_bad <>
    writing in news:46ff26ee$0$3588$5a62ac22@per-qv1-newsreader-
    01.iinet.net.au:

    > Let's say I need somethink like that below.
    >
    >
    > Especially with h3 or bold. How can I change colors?
    >
    > Sometimes I need just one letter in different color!
    >
    > Google doesn't help a lot.
    >
    > Help!
    >



    <style type="text/css">
    body {background-color: #fff; color:#000;}
    ..serengeti {
    color: #B58E73;
    }
    ..saintmartinsand {
    color: #D6B6A5;
    }
    ..middleburybrown {
    color: #6B594A;
    }
    ..monticellorose {
    color: #CEAE9C;
    }
    ..westonflax {
    color: #F7E3B5;
    }
    </style>
    </head>
    <body>
    <h3>Color Nonsense</h3>
    <p><span class="serengeti">Serengeti</span> is not the same color as
    <span class="saintmartinsand">St. Martin Sand</span> and is not the same
    color as <span class="middleburybrown">Middlebury Brown</span>, and not
    <span class="monicellorose">Monticello Rose</span> and certainly not
    <span class="westonflax">Weston Flax</span>. Got it?</p>

    --
    Adrienne Boswell at Home
    Arbpen Web Site Design Services
    http://www.cavalcade-of-coding.info
    Please respond to the group so others can share
     
    Adrienne Boswell, Sep 30, 2007
    #2
    1. Advertising

  3. not_bad

    Jim Moe Guest

    not_bad wrote:
    >
    > Google doesn't help a lot.
    >

    !?!

    See <http://www.w3.org/TR/CSS21/>
    Also there are a number of excellent books on CSS. Buy one.

    --
    jmm (hyphen) list (at) sohnen-moe (dot) com
    (Remove .AXSPAMGN for email)
     
    Jim Moe, Sep 30, 2007
    #3
  4. not_bad

    not_bad Guest

    Adrienne Boswell wrote:
    > Gazing into my crystal ball I observed not_bad <>
    > writing in news:46ff26ee$0$3588$5a62ac22@per-qv1-newsreader-
    > 01.iinet.net.au:




    Wow! Span is the trick!?


    Many thanks!!!

    :)
     
    not_bad, Sep 30, 2007
    #4
  5. Scripsit not_bad:

    > Wow! Span is the trick!?


    No, and span isn't CSS at all. The color property is the "trick".
    Surprising, is it not?

    Use of span is a usual sign of lack of understanding of markup issues,
    though if giving abstract advice to a generic question, formulated in
    foobarish (aka Lorem ipsum), there's little else one can use, since any
    other inline element could be semantically _wrong_. The span element is
    _meaningless_, i.e. semantically empty.

    However, you could just as well use <font
    class="serengeti">Serengeti</font>, being somewhat honest about it: you are
    just thinking in terms of coloring words, not in terms of expressing
    semantic or structural relationships.

    If you want to save typing, <a class="serengeti">Serengeti</a> would be an
    interesting option.

    --
    Jukka K. Korpela ("Yucca")
    http://www.cs.tut.fi/~jkorpela/
     
    Jukka K. Korpela, Sep 30, 2007
    #5
  6. not_bad

    Andy Dingley Guest

    On 30 Sep, 07:15, Jim Moe <> wrote:
    > not_bad wrote:
    >
    > > Google doesn't help a lot.

    > !?!


    Well, indeed 8-(

    > Also there are a number of excellent books on CSS. Buy one.


    Also there are even more bad ones. Buy Lie & Bos' book, which is a
    good one.
     
    Andy Dingley, Oct 1, 2007
    #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. Amil Hanish
    Replies:
    3
    Views:
    2,001
    darrel
    Apr 23, 2004
  2. Mike

    change textbox colors in code

    Mike, Jun 2, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    3,185
    Alexandre Soares
    Jun 2, 2004
  3. AAaron123

    TreeNode colors come from anchor colors

    AAaron123, Aug 7, 2008, in forum: ASP .Net
    Replies:
    1
    Views:
    562
    darrel
    Aug 7, 2008
  4. ZelluX
    Replies:
    3
    Views:
    1,960
    Peter Otten
    Dec 1, 2008
  5. Ken  Ingram

    Can You Change Colors on GridLines?

    Ken Ingram, Jan 29, 2005, in forum: ASP .Net Datagrid Control
    Replies:
    0
    Views:
    150
    Ken Ingram
    Jan 29, 2005
Loading...

Share This Page