6

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...

user3307827
  • 546
  • 1
  • 6
  • 20

3 Answers3

5

Sure, use rgba():

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

jsFiddle example

j08691
  • 197,815
  • 30
  • 248
  • 265
3

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

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

Jatin
  • 3,005
  • 6
  • 27
  • 42
apohl
  • 1,868
  • 26
  • 29
2

Use rgba() to get that transparent background you need, like this:

background: rgba(255,0,0,0.5);

ntzm
  • 4,541
  • 2
  • 30
  • 35