font color as css

Discussion in 'HTML' started by jodleren, Dec 4, 2007.

  1. jodleren

    jodleren Guest

    Hello!

    I dont know much about CSS, but in order to get the same colours all
    the time, I try

    message_ok { color: #ff0000; }
    message_fail { color: #008000; }

    Then
    <font class="message_ok">Success!<font>
    <font class="message_fail">Something went wrong...<font>

    But, why does this not work?
    jodleren, Dec 4, 2007
    #1
    1. Advertising

  2. jodleren

    dorayme Guest

    In article
    <
    m>,
    jodleren <> wrote:

    > Hello!
    >
    > I dont know much about CSS, but in order to get the same colours all
    > the time, I try
    >
    > message_ok { color: #ff0000; }
    > message_fail { color: #008000; }
    >
    > Then
    > <font class="message_ok">Success!<font>
    > <font class="message_fail">Something went wrong...<font>
    >
    > But, why does this not work?


    There is the tiniest possible reason, a missing stop sign. Try
    ..message_ok { color: #ff0000;} The stop is the class indicator in
    CSS. The id indicator is #

    --
    dorayme
    dorayme, Dec 4, 2007
    #2
    1. Advertising

  3. jodleren

    dorayme Guest

    In article
    <>,
    dorayme <> wrote:

    > In article
    > <
    > m>,
    > jodleren <> wrote:
    >
    > > Hello!
    > >
    > > I dont know much about CSS, but in order to get the same colours all
    > > the time, I try
    > >
    > > message_ok { color: #ff0000; }
    > > message_fail { color: #008000; }
    > >
    > > Then
    > > <font class="message_ok">Success!<font>
    > > <font class="message_fail">Something went wrong...<font>
    > >
    > > But, why does this not work?

    >
    > There is the tiniest possible reason, a missing stop sign. Try
    > .message_ok { color: #ff0000;} The stop is the class indicator in
    > CSS. The id indicator is #


    Oops and there's more, I did not read on... You can't have <font
    class=...>

    If you want all text in one element to be as one color and
    another another color just class the element and set the style.
    For example,

    <p class="message_ok">This will be red</p>
    <p class="message_fail">This will be greenish</p>

    in your html

    and

    ..message_ok {color: #ff0000; background: #fff;}
    ..message_fail {color: #008000; background: #fff;}

    --
    dorayme
    dorayme, Dec 4, 2007
    #3
  4. jodleren

    rf Guest

    "jodleren" <> wrote in message
    news:...
    > Hello!
    >
    > I dont know much about CSS, but in order to get the same colours all
    > the time, I try
    >
    > message_ok { color: #ff0000; }
    > message_fail { color: #008000; }


    As dorayme says,
    ..message

    > Then
    > <font class="message_ok">Success!<font>


    That last should surely be </font>

    Why are you using the deprecated font element?
    <p class="message_ok">Success!</p>

    or even
    <span class="message_ok">Success!</span>

    I would think red for the fail and green for success though.

    --
    Richard.
    rf, Dec 4, 2007
    #4
  5. jodleren

    rf Guest

    "dorayme" <> wrote in message
    news:...
    > In article
    > <>,
    > dorayme <> wrote:


    > Oops and there's more, I did not read on... You can't have <font
    > class=...>


    Why?

    Apart from font being deprecated that is.

    --
    Richard.
    rf, Dec 4, 2007
    #5
  6. jodleren

    Ben C Guest

    On 2007-12-04, dorayme <> wrote:
    > In article

    [...]
    >> > I dont know much about CSS, but in order to get the same colours all
    >> > the time, I try
    >> >
    >> > message_ok { color: #ff0000; }
    >> > message_fail { color: #008000; }
    >> >
    >> > Then
    >> > <font class="message_ok">Success!<font>
    >> > <font class="message_fail">Something went wrong...<font>
    >> >
    >> > But, why does this not work?

    >>
    >> There is the tiniest possible reason, a missing stop sign. Try
    >> .message_ok { color: #ff0000;} The stop is the class indicator in
    >> CSS. The id indicator is #

    >
    > Oops and there's more, I did not read on... You can't have <font
    > class=...>


    Why not? As far as I can see it's valid and OK and works (although using
    <font> at all is deprecated).
    Ben C, Dec 4, 2007
    #6
  7. jodleren

    dorayme Guest

    In article <WR75j.20113$>,
    "rf" <> wrote:

    > "dorayme" <> wrote in message
    > news:...
    > > In article
    > > <>,
    > > dorayme <> wrote:

    >
    > > Oops and there's more, I did not read on... You can't have <font
    > > class=...>

    >
    > Why?
    >
    > Apart from font being deprecated that is.


    You can have it if you close it right. I was too impatient with
    the whole thing quoted... at least you mentioned the lack of a
    proper closing, I was referring to the whole thing and just
    wanted to give a better alternative to OP.

    How am I going? I just find that I can get out of most things if
    I keep talking... real fast... <g>

    --
    dorayme
    dorayme, Dec 4, 2007
    #7
  8. jodleren

    Bone Ur Guest

    Well bust mah britches and call me cheeky, on Tue, 04 Dec 2007 07:57:07 GMT
    rf scribed:

    >> I dont know much about CSS, but in order to get the same colours all
    >> the time, I try
    >>
    >> message_ok { color: #ff0000; }
    >> message_fail { color: #008000; }

    >
    > As dorayme says,
    > .message
    >
    >> Then
    >> <font class="message_ok">Success!<font>

    >
    > That last should surely be </font>
    >
    > Why are you using the deprecated font element?
    > <p class="message_ok">Success!</p>
    >
    > or even
    > <span class="message_ok">Success!</span>
    >
    > I would think red for the fail and green for success though.


    I used to be an electrician. Typically, a motor starter or motor control
    switching center would have running lights on each, green for when the
    device was operating and red for when it was off to the remote. Using
    impeccable logic, this one corporation reversed that procedure because, in
    their engineers' opinion, a running motor was dangerous while a stopped
    motor was safe to inspect/work-on/etc. Whether there is any validity to
    that or not, can you imagine the confusion it caused for maintenance people
    and users, not to mention the actual real-life danger?

    I only brought this up because somehow it reminds me of Microsoft.

    --
    Bone Ur
    Cavemen have formidable pheromones.
    Bone Ur, Dec 4, 2007
    #8
  9. jodleren

    dorayme Guest

    In article <>,
    Ben C <> wrote:

    > On 2007-12-04, dorayme <> wrote:
    > > In article

    > [...]
    > >> > I dont know much about CSS, but in order to get the same colours all
    > >> > the time, I try
    > >> >
    > >> > message_ok { color: #ff0000; }
    > >> > message_fail { color: #008000; }
    > >> >
    > >> > Then
    > >> > <font class="message_ok">Success!<font>
    > >> > <font class="message_fail">Something went wrong...<font>
    > >> >
    > >> > But, why does this not work?
    > >>
    > >> There is the tiniest possible reason, a missing stop sign. Try
    > >> .message_ok { color: #ff0000;} The stop is the class indicator in
    > >> CSS. The id indicator is #

    > >
    > > Oops and there's more, I did not read on... You can't have <font
    > > class=...>

    >
    > Why not? As far as I can see it's valid and OK and works (although using
    > <font> at all is deprecated).


    It is valid if the element is closed right, I was too anxious to
    show OP a better way and did not stop to consider my words
    carefully enough. I got a temporary fright when I saw my first
    correct reply to op. Correctness frightens me and unbalances my
    mind. <g>

    --
    dorayme
    dorayme, Dec 4, 2007
    #9
  10. jodleren

    Ed Mullen Guest

    jodleren wrote:
    > Hello!
    >
    > I dont know much about CSS, but in order to get the same colours all
    > the time, I try
    >
    > message_ok { color: #ff0000; }
    > message_fail { color: #008000; }
    >
    > Then
    > <font class="message_ok">Success!<font>
    > <font class="message_fail">Something went wrong...<font>
    >
    > But, why does this not work?


    Aside from the comments on how to do that properly I have to ask:

    Why red for an "ok" condition and green for a "fail" condition? Seems
    counter-intuitive to me.

    --
    Ed Mullen
    http://edmullen.net
    http://mozilla.edmullen.net
    http://abington.edmullen.net
    How come a slight tax increase costs you two hundred dollars and a
    substantial tax cut saves you thirty cents?
    Ed Mullen, Dec 4, 2007
    #10
  11. jodleren

    DocuMaker Guest

    On Dec 3, 11:32 pm, jodleren <> wrote:
    > Hello!
    >
    > I dont know much about CSS, but in order to get the same colours all
    > the time, I try
    >
    > message_ok { color: #ff0000; }
    > message_fail { color: #008000; }
    >
    > Then
    > <font class="message_ok">Success!<font>
    > <font class="message_fail">Something went wrong...<font>
    >
    > But, why does this not work?



    Well for one thing, the end font tags should be closed: "</FONT>"

    ---
    http://www.outsource2documaker.com
    Managing outsourced projects ranging from fine artwork and business
    graphics to website design and maintenance.
    DocuMaker, Dec 4, 2007
    #11
    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. Karl Hungus

    Font class, external font files question

    Karl Hungus, Feb 4, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    523
    Karl Hungus
    Feb 4, 2004
  2. =?Utf-8?B?Tmlja3k=?=
    Replies:
    2
    Views:
    705
    Matt Berther
    Feb 20, 2005
  3. Michael Glavitsch
    Replies:
    1
    Views:
    759
    Roedy Green
    Jul 15, 2003
  4. mttc
    Replies:
    2
    Views:
    2,381
    Roedy Green
    Jul 3, 2009
  5. Kamaljeet Saini
    Replies:
    0
    Views:
    403
    Kamaljeet Saini
    Feb 13, 2009
Loading...

Share This Page