CSS opacity only to background color, not the text on it? [duplicate]
This question already has an answer here: How do I give text or an image a transparent background using CSS? 28 answers Can I assign the opacity property to the background property of a div only and not to the text on it? I've tried: background: #CCC; opacity: 0.6; but this doesn't change the opacity. It sounds like you want to use a transparent background, in which case you could try using the rgba() function: rgba(R, G, B, A) R (red), G (green), and B (blue) can be either <integer> s or <percentage> s, where the number 255 corresponds to 100%. A (alpha) can be a <number> between 0 and 1, or