• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 212
  • Last Modified:

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
2 Solutions
#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.

Chris StanyonCommented:
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...
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Train for your Pen Testing Engineer Certification

Enroll today in this bundle of courses to gain experience in the logistics of pen testing, Linux fundamentals, vulnerability assessments, detecting live systems, and more! This series, valued at $3,000, is free for Premium members, Team Accounts, and Qualified Experts.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now