What is the difference between `lightgrey` and `lightgray` in CSS?
Asked Answered
S

6

9

I am using Microsoft Visual Studio 2012 to edit my CSS. When I wanted to use a light gray color, the IntelliSense suggested me this:

enter image description here

Is there any difference?

Schaffhausen answered 11/7, 2015 at 17:10 Comment(2)
Pretty easy to lookup yourself: w3.org/TR/css3-colorOxendine
Other than a Hamming distance of 1?Ablution
P
14

According to CSS3 Color, there is no difference:

┌────────────┬─────────┬─────────────┐
│ Color name │ Hex rgb │   Decimal   │
├────────────┼─────────┼─────────────┤
│ lightgray  │ #d3d3d3 │ 211,211,211 │
│ lightgrey  │ #d3d3d3 │ 211,211,211 │
└────────────┴─────────┴─────────────┘
Pennyworth answered 11/7, 2015 at 17:14 Comment(2)
Probably included just to cater to both US and UK spellingsVertebra
@Vertebra Digging deeper - probably because both spellings were standard X11 color names, which is where CSS got most of its named colors from.Parliament
G
10

en-US:

.foo { color: gray; }

en-UK:

.foo { colour: grey; }

since colouris not supported, use gray

Gumdrop answered 6/3, 2018 at 10:8 Comment(0)
M
3

They are exactly the same color , check this article for more information.

Gray is the more popular spelling in the US, while grey reigns supreme in the UK.

Mielke answered 11/7, 2015 at 17:16 Comment(3)
The question is whether there's a technical difference, not what the words mean from a linguistic standpoint.Parliament
Did you read They are exactly the same color part of my answer ? @duskwuffMielke
The article that you're linking is talking about the English language meaning of the words. While it's true in this case that they're also identical in this particular programming meaning, English language and computers don't always agree — consider "referer" vs. "referrer", for instance.Parliament
O
2

I've found in IE7 that "lightgrey" maps to a light grey/gray color but "lightgray" maps to a darker grey/gray. So I'd recommend you use the rgb values to get the color you desire across older browsers.

Osteen answered 5/12, 2015 at 23:39 Comment(0)
O
1

lightgray is not supported by IE ≤7; lightgrey is supported though.
That's the difference.

Oneway answered 12/2, 2021 at 20:54 Comment(0)
E
0

Thats confusing I think its the IntelliSense dictionary problem in US dictionary its spelled as LIGHTGRAY and in UK dictionary its LIGHTGREY. But it should give same color value.

Encephalography answered 11/7, 2015 at 17:17 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.