DEV Community

Marius Eisenbraun
Marius Eisenbraun

Posted on

3 1

TIL: In CSS, DarkGray is lighter than Gray

When building prototypes or examples, I often use named CSS colors.

After playing around and working with CSS for some years, today I learnt:

DarkGray is lighter than Gray 🤔

It got me so confused, I had to check it three times.

The easy solution:
If you want a "dark gray", choose DimGray.☝️

Top comments (4)

Collapse
 
patarapolw profile image
Pacharapol Withayasakpunt

Codepen? please.

Collapse
 
gillmangareth profile image
Gareth Gillman

codepen.io/garethTF/pen/gObeVYY

Seems wierd but it's true... CSS is confusing at times.

Collapse
 
mr_eis profile image
Marius Eisenbraun

Oh someone was faster than me :D

Thanks, for the CodePen!

Collapse
 
johnnykoo84 profile image
Johnny Ilmo Koo

never knew about it until I see this post Thanks

Some comments may only be visible to logged-in visitors. Sign in to view all comments.

👋 Kindness is contagious

Engage with a wealth of insights in this thoughtful article, valued within the supportive DEV Community. Coders of every background are welcome to join in and add to our collective wisdom.

A sincere "thank you" often brightens someone’s day. Share your gratitude in the comments below!

On DEV, the act of sharing knowledge eases our journey and fortifies our community ties. Found value in this? A quick thank you to the author can make a significant impact.

Okay