Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > font color as css

Reply
Thread Tools

font color as css

 
 
jodleren
Guest
Posts: n/a
 
      12-04-2007
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?
 
Reply With Quote
 
 
 
 
dorayme
Guest
Posts: n/a
 
      12-04-2007
In article
<fa39f645-1b00-4352-9836-
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
 
Reply With Quote
 
 
 
 
dorayme
Guest
Posts: n/a
 
      12-04-2007
In article
<doraymeRidThis->,
dorayme <> wrote:

> In article
> <fa39f645-1b00-4352-9836-
> 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
 
Reply With Quote
 
rf
Guest
Posts: n/a
 
      12-04-2007

"jodleren" <> wrote in message
news:fa39f645-1b00-4352-9836-...
> 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.


 
Reply With Quote
 
rf
Guest
Posts: n/a
 
      12-04-2007

"dorayme" <> wrote in message
news:doraymeRidThis-...
> In article
> <doraymeRidThis->,
> 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.


 
Reply With Quote
 
Ben C
Guest
Posts: n/a
 
      12-04-2007
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).
 
Reply With Quote
 
dorayme
Guest
Posts: n/a
 
      12-04-2007
In article <WR75j.20113$>,
"rf" <> wrote:

> "dorayme" <> wrote in message
> news:doraymeRidThis-...
> > In article
> > <doraymeRidThis->,
> > 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
 
Reply With Quote
 
Bone Ur
Guest
Posts: n/a
 
      12-04-2007
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.
 
Reply With Quote
 
dorayme
Guest
Posts: n/a
 
      12-04-2007
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
 
Reply With Quote
 
Ed Mullen
Guest
Posts: n/a
 
      12-04-2007
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?
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Swing Font, it's Java Font? ot native? how install new font? mttc Java 2 07-03-2009 07:29 PM
Changing font color from current font color to black color Kamaljeet Saini Ruby 0 02-13-2009 04:58 PM
How to get the text in html tag.like<div...><font...>Text</font></ =?Utf-8?B?Tmlja3k=?= ASP .Net 2 02-20-2005 03:03 PM
Font class, external font files question Karl Hungus ASP .Net 1 02-04-2004 04:26 PM
physical font specified but true type font file not available Michael Glavitsch Java 1 07-15-2003 07:09 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57