dazzafact
dazzafact

Reputation: 2860

Css - Separate Color Transparents

Is it possible to define only the color-transparent? for Example

<h3 class="header">header</h3>
h3{
  color:red;
}
.header{
  color:rgba(null,null,null,0.3);/* red 30%*/
}

Upvotes: 0

Views: 42

Answers (2)

Mai
Mai

Reputation: 338

Use opacity: 0.3

If you want the element to be look like invisible, use the value of 0.

A value of 1 has no transparency.

Upvotes: 1

pavel
pavel

Reputation: 27072

RGBa is working with background only, see the opacity:

h3 {color: red; opacity: .3}

http://jsfiddle.net/dbk574fu/

Of course, opacity makes the background transparent too, if you need to use background for this element, you have to add a wrapper into HTML and set background image to this wrapper, not to h3 element.

<div class=header>
    <h3>headline</h3>
</div>

.header {background: green;}
.header h3 {background: red; opacity: .3}
/* there will be green background and red semi-transparent text */

Upvotes: 0

Related Questions