how to leave the video without the transparent background?

Asked

Viewed 544 times

0

I’m using a transparentbox with youtube videos inside it, how do I leave the videos without the transparent background?

my website

  • The background of the videos seem normal, what this semi-opaque is the background of the DIV where the Divs are located, if you want to leave in remove the effect just exchange rgba for Hex or rgb, for example, change .transbox { background-color: rgba(255,255,255,0.7); } for .transbox { background-color: #ffffff; }, although I don’t think that’s what you want. I could explain better?

  • Vlw Guilherme, what Isac suggested worked. Thanks anyway.

  • Oh understood, is that you had already edited, I’ll tell you one thing, instead of links always post the code, my comment came out wrong because you had already "fixed" your CSS, so lost the sense, we are not a technical support site, put the code "failed" here makes all the difference and on top of that can help other users with the same doubt.

1 answer

1


Bearing in mind that the <div> of youtube is inside the <div> transbox transparency is inherited, and is at most with 0.7, which is what it has. This <div> youtube may thus be more transparent, but not more opaque.

A simple solution is to apply transparency through the background color with rgba, which receives the 3 color values and the last one for alpha which is the opacity.

So this:

.transbox {
    ...
    background-color: #ffffff;
    opacity: 0.7;
}

Becomes:

.transbox {
    ...
    background-color: rgba(255,255,255,0.7); //255,255,255 corresponde a branco
}

What makes the <div class="youtube"> that contain the <iframe> becomes opaque, due to the color already assigned without opacity.

  • Thanks, it worked out.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.