I'm using a transparentbox with youtube videos inside it, how do I leave the videos without the transparent background?
I'm using a transparentbox with youtube videos inside it, how do I leave the videos without the transparent background?
Given that <div>
of youtube
is within <div>
transbox
transparency is inherited, and gets maximum with 0.7
, which is what it has. This <div>
youtube
can thus be more transparent, but not more opaque.
A simple solution is to apply transparency through the background color with rgba
, which gets the 3 color values and the last one for alpha which is the opacity.
Then this:
.transbox {
...
background-color: #ffffff;
opacity: 0.7;
}
It happens:
.transbox {
...
background-color: rgba(255,255,255,0.7); //255,255,255 corresponde a branco
}
What causes <div class="youtube">
to contain <iframe>
to be opaque because of the color it already assigns without opacity.