font color as css

J

jodleren

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?
 
D

dorayme

<[email protected]
m>,
jodleren said:
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 #
 
D

dorayme

dorayme said:
<[email protected]
m>,


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;}
 
R

rf

jodleren said:
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.
 
B

Ben C

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 #[/QUOTE]

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

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

dorayme

"rf said:
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>
 
B

Bone Ur

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


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.
 
D

dorayme

Ben C said:
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).[/QUOTE]

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>
 
E

Ed Mullen

jodleren said:
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?
 
D

DocuMaker

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>"
 

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

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top