Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there any way to opacity only background of a text in css? [duplicate]

Tags:

html

css

opacity

Is there a way to opacity only background-color of a text in css?(not text color...just background-color of The text)....I do not want use image background.

This is an example:

enter link description here

background is opacity but the text is opacity too...I do not want it...

like image 370
user3307827 Avatar asked Mar 05 '14 21:03

user3307827


2 Answers

Sure, use rgba():

div ul li a.title {
    padding: 0px 12px 0 0px;
    background:rgba(255,0,0,.2);
}

jsFiddle example

like image 127
j08691 Avatar answered Oct 28 '22 04:10

j08691


Use background: rgba(255, 0, 0, .2);

http://fiddle.jshell.net/wLmAC/1/

like image 37
apohl Avatar answered Oct 28 '22 04:10

apohl