Is there a difference between #FFF
(#FFFFFF
) and white
in CSS? Is one better than the other?
All are supported in the major browsers. It comes down to whichever unjustifiable, deep-seated prejudice you personally have for/against hexadecimal/the English language.
They're all guaranteed to be the same. CSS 3 Color Module (a Proposed Recommendation) defines white as #ffffff.
It later says that values like #rgb are converted to #rrggbb:
The three-digit RGB notation (#rgb) is converted into six-digit form (#rrggbb) by replicating digits, not by adding zeros. For example, #fb0 expands to #ffbb00.
That means that #fff is equivalent to #ffffff (by doubling).
there is no difference. I would imagine browsers take "white" and translate it to "#FFFFFF" in the background. its just a matter of personal coding style which you will use. I prefer using hash because its easier to read and recognise as a colour
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With