Why color codes dont work in css ? [only words working]!

HTML, CSS and anything else that deals with client side capabilities.

Moderator: General Moderators

Post Reply
mekha
Forum Contributor
Posts: 112
Joined: Sat Mar 31, 2012 6:50 am

Why color codes dont work in css ? [only words working]!

Post by mekha »

hi guys,
Why color codes dont work in css ? [only words working]!?
.. i mean
if i put:
.xxx a{
color:red;
}
no problems!..
but if
.xxx a{
color:#ff0000;
}

the color doesnt work!


any help please?
User avatar
social_experiment
DevNet Master
Posts: 2793
Joined: Sun Feb 15, 2009 11:08 am
Location: .za

Re: Why color codes dont work in css ? [only words working]!

Post by social_experiment »

Is this related to a specific browser or in all the browsers you have tested the code in
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering
mekha
Forum Contributor
Posts: 112
Joined: Sat Mar 31, 2012 6:50 am

Re: Why color codes dont work in css ? [only words working]!

Post by mekha »

all browsers! :S
User avatar
social_experiment
DevNet Master
Posts: 2793
Joined: Sun Feb 15, 2009 11:08 am
Location: .za

Re: Why color codes dont work in css ? [only words working]!

Post by social_experiment »

curious indeed; validate the css file via w3c.org's css validator. i've encountered situations where a missing { or an incorrect declaration causes the browser to react differently than expected

hth :)
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering
annaharris
Forum Commoner
Posts: 30
Joined: Mon Mar 25, 2013 6:52 am

Re: Why color codes dont work in css ? [only words working]!

Post by annaharris »

I was trying with same code and it is working with my css.
priyankagound
Forum Commoner
Posts: 27
Joined: Thu Sep 19, 2013 2:53 am

Re: Why color codes dont work in css ? [only words working]!

Post by priyankagound »

I'll prefer the hex value since it is supported by all browsers and I can specify wide range of colors than the named colors.
Post Reply