Reputation: 3037
css:
h1 {color:#000;}
html:
<h1>This is heading 1</h1>
Question:
Is there any difference between color:#000;
(hexadecimal color value in shorthand) and color:#000000
(hexadecimal color value)?
Upvotes: 3
Views: 1799
Reputation: 85575
There is no difference in both color but color: #000000;
is more preferable to use for eg you can change with more colors that is #010101;
but you can't do this in #000;
With first #000 it can select 8-bit color but with second #000000 it can select 16-bit color
Upvotes: 1
Reputation: 166011
There is no difference at all. As per the CSS Color Module spec:
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. This ensures that white (#ffffff) can be specified with the short notation (#fff)...
Upvotes: 7
Reputation: 1007
No there is no difference. They describe exactly the same. Only shorter and easier to read.
Upvotes: 1