gizmo
gizmo

Reputation: 201

CSS overlay vs same looking other color

Strange I faced this question just now - are there any differences between css background color overlay and same looking color? For ex: designer designed buttons for hover, focus etc. On hover he wrote - overlay #FFF 15%. Now sice we use mixins and colors are hex, I have two choices - wrap element with other div or convert my rgba color rgba(255,255,255,0.15) to rgba #FFFFFF26 and use a pseudo class to apply it on hover.

It looks ugly, why not just other background color on hover?

I can get a hex color like this rgba(255,255,255,0.15) and it looks the same...

What are the benefits of overlay color (are there any?)?

Upvotes: 0

Views: 219

Answers (1)

Raul
Raul

Reputation: 1024

If you have overlay with transparency then the background color will be seen through the overlay. If you apply directly on the button then what is behind it will show (in most cases white) so you have 2 different results

Upvotes: 1

Related Questions