Saturday, 27. January 2018

If you make a div to have opacity from 0 to 1, everything within the div will be having the opacity including the text. To keep the text clear without affected by opacity, use the following style instead:

opacity: 0=transparent; 1=opaque;

background-color:rgb(255,0,0,0.1) /* 10% opaque red */
background-color:rgb(255,0,0,0.4) /* 40% opaque red */
background-color:rgb(255,0,0,0.7) /* 70% opaque red */
background-color:rgb(255,0,0, 1) /* full opaque red */

Styling is for the background and not the div.

source: https://stackoverflow.com/questions/5135019/css-opacity-only-to-background-color-not-the-text-on-it

Comments are closed.