html colors

Is hex color #FFF   the same as #F0F0F0 or #FFFFFF ?

Why do some places use 3 digit color codes like this: #FFF
while other website uses 6 digit color codes like this #FFF000
LVL 1
maqskywalkerAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

COBOLdinosaurCommented:
#fff is the same as #ffffff, the shortcut get expanded by replicating the digits for each of the three color segments.

Using the 3 digit format is simple a shortcut and jus one of the options for specifying colors.

it is also possible to use decimal values with and rgb format and to use colorname.

Cd&
0
Chris StanyonWebDevCommented:
You can only use the 3 digit version if each set is repeated:

#abc = #aabbcc
#fff = #ffffff = black = rgb(0,0,0) = rgba(0, 0, 0, 1)

5 different ways of setting colours!

rgba is CSS3 and the extra bit (the a) if for alpha (transparancy) - 1 is opaque, 0 is transparent and anything inbetween is slightly see-through...
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
HTML

From novice to tech pro — start learning today.