[CSS] Colours

Soldato
Joined
12 Jun 2005
Posts
5,361
Hi there,

Quick Question, I have recently been seeing people using a 3 character colour code instead of the full 6.

Maybe this has been done for a while, but how do i know which colours I can put into a 3 character code after the "#"? Also how do I know what the code is?

I already know that you can do if for the colours that have the same character for the whole 6 characters of the colour code?

Thanks...
 
I think it's for block colours. That contain just one character.

So,

Code:
color: #ffffff;

can be shortened to:

Code:
color: #fff;
 
I only ask as I believe i have seen it done is other colours that have maybe 2 or more different characters?

Like for instance here:

Code:
border:1px solid #c00;
 
I think it's to cut off the block at the end.

Code:
border:1px solid #c00;

is a shortened version of

Code:
border:1px solid #c00000;
 
Back
Top Bottom