🔥 TIL: Hex code and Opacity

Published on February 17, 2020


When writing background color with opacity, I usually use background-color: rgba(0,0,0,0.5) then I just found out that you can add to the last option of hex code the opacity using background-color: #00000080

Yup, 80 is equivalent to 50% opacity. For more information https://css-tricks.com/8-digit-hex-codes/