tags:

views:

311

answers:

8

Which is better to define color?

color:#fff;

or

color:#FFF;

?

I like #FFF because it catch your eyes' focus faster than #fff. But PS returns lowercase, so I was wondering if lowercase hexadecimal is better than uppercase. Why this thread closed? o.Oa

A: 

#FFFFFF is better using in CSS

Aman
To repeat what @Felix Kling said: *Better* in terms of what?
jensgram
`#FFFFFF` or `#ffffff`?
Gareth
Or `#FfFffF` - or ... :) It doesn't matter. *That's* the better approach.
jensgram
`white` is better.
KennyTM
+1  A: 

Between below two there is no difference.

color:#fff;
or

color:#FFF;

CSS Color Codes

Go for : #FFFFFF this kind of hexa color than rather than short hand.

In CSS, you define a color using either the hexadecimal color code, the RGB color code, or the actual color name. A benefit of using hexadecimal and RGB color codes is that you have many more options than just supplying a color name.

The color picker and chart on this page provide you with the hexadecimal color codes. The color picker also provides the RGB color code.

Hexadecimal color codes are often referred to as "hexadecimal colors", "hex colors codes", "color values" and a few other terms. "Hexadecimal color values" is probably the most accurate term as they are made up of hexadecimal numbers.

Pranay Rana
Thanks, Pranay.
Jeaffrey Gilbert
But `#fff` saves you three bytes, so what's the benefit of using `#ffffff` if they mean the same thing?
Matt Huggins
@Matt Huggins yeah, reducing file size never been a bad thing.
Jeaffrey Gilbert
A: 

If you are talking about case sensitivity then it does not effect.

http://en.wikipedia.org/wiki/HTML_color_names

In HTML, documents using 4.01 specifications colors can be specified by name. Names are defined in this context to be case-insensitive. Using colors in HTML has been deprecated in favor of CSS.favor of CSS.

jsfiddle.net

NAVEED
No he isn’t. `#FFF` is completely valid: `#RGB` is an abbreviation for `#RRGGBB` in CSS.
Konrad Rudolph
@Konrad: Ok. If #fff is valid then I removed the part that is making it invalid.
NAVEED
And #fff is observiation of ? Or it is valid color code.
NAVEED
@NAVEED yes, you can define white with #fff. Thanks for your answer anyway.@Konrad Rudolph thank you.
Jeaffrey Gilbert
+6  A: 

Neither;

color: white;

In all seriousness, tho', it doesn't matter so long as it matches the general design of your site. (For example, SO or FB should use #FFF, while, say, Apple would use #fff. Matches the rounded corners better, you see?)

Williham Totland
What about `#fc28d9` vs `#FC28D9`?
BoltClock
Don't be such a fancy-pants; just use `fuchsia`. P:
Williham Totland
http://www.colourlovers.com/color/fc28d9
troelskn
@Williham Totland thanks Wil :) I though point 5 here (http://sixrevisions.com/css/12-common-css-mistakes-web-developers-make/) is absolutely right.@troelskn thanks, nice website.
Jeaffrey Gilbert
Actually, point 5 is only kind of right. A lot of the time you'll want to violate the hell out of that rule; especially if you want your site to actually care about your user; using the system colors for selected text and such, for example, can only be done using color names (there's a slew of special color names for this purpose).
Williham Totland
And the point 5 there is confused anyway; you haven't actually achieved anything by using #F00 (== #FF0000) instead of red; red, by its very definition, **is** #FF0000. The only thing you have achieved is that the browser now display what it thinks *#FF0000* is; which still may or may not be the color you are after (what with color calibration and whatnot). Color names have defined hex value equivalents, and using the hex value equivalents instead of color names only serve to confuse matters and make your CSS more difficult to read. (A couple of other points in there are a bit off, as well…)
Williham Totland
+1  A: 

The convention for Hex in CS has always been uppercase (as far as I know), with web designers it tends to be lowercase - the only thing that is "better" is sticking to one scheme and using it only. Switching back and forth just looks messy.

Mauro
With PS CS5, the color picker returns lowercase hex code. Yes I agree, I type color name just for testing, but sometimes I forgot to change it to hex code. Thanks, Mauro.
Jeaffrey Gilbert
+1  A: 

Pff I prefer

color: rgb(255,255,255)
Louis
Meh, `rgba(255, 255, 255, 1);`
BoltClock
@Louis I often use color picker from PS or PHOTO-PAINT and it returns hexa color value, but thanks.
Jeaffrey Gilbert
@Bolt: You're a genius!
Louis
+2  A: 

It depends what colour you want. #fff is 'white' and #FFF is 'WHITE'. Your choice.

Joe
You should avoid using "white" or "WHITE" at all, cause it's racist CSS.
acme
@Joe alright, thank you. @acme ahahah it's funny :)
Jeaffrey Gilbert
+1  A: 

Keep in mind: #fff is the little brother of #FFF. So it's your choice: support the new talents or trust in the experience of the elder pro.

If you're preferring fat people, go for #FFFFFF (or #ffffff if you like fat kids more).

acme
I like #FFF because it catch your eyes' focus faster than #fff. But PS returns lowercase, so I was wondering if lowercase hexadecimal is better than uppercase.
Jeaffrey Gilbert
In terms of readability I also do prefer the uppercase version. And because most other programs display hexadecimal things as uppercase letters I usually use the uppercase in css.
acme