pavlenko
pavlenko

Reputation: 665

Bootstrap 3 add opacity to thumbnail background

I am trying to add opacity to thumbnail class in bootstrap, but I just want to use opacity on background color not to other text in section. If I use :

.thumbnail {
opacity: 0.6;
}

this adapt on hole content, and I am trying to paragraph tags don't use this opacity. Tnx,P

<div class="col-sm-6 col-md-3">
    <div class="thumbnail">
      <img src="img/box/1.jpg" alt="...">
      <div class="caption">
        <h3 >Test</h3>
        <p >
Testtt
        </p>
        <p><a href="#" >Link</a></p>
      </div>
    </div>
  </div>

Upvotes: 0

Views: 2849

Answers (1)

Mivaweb
Mivaweb

Reputation: 5732

Is it the image that is full background of the thumbnail then simply use:

.thumbnail > img {
    opacity: 0.6;
}

If you use a background style on the thumbnail then use:

.thumbnail {
    background-color: rgba(0, 0, 0, 0.6);
}

Upvotes: 1

Related Questions