I have a site that gets divided into multiple columns. Whenever an element is not in the first column and has opacity set to < 1, it doesn't get rendered when its container has both the overflow y and border radius properties.
Shown in this fiddle
css
.main {
-webkit-column-width: 100px;
column-width: 100px;
max-height: 200px;
}
.main > div {
overflow-y:auto;
border-radius: 6px;
}
.opac {
opacity: 0.5;
}
html
<div class="main">
<div>
<div class="opac">element 1</div>
</div>
<div>
<div class="opac">element 2</div>
</div>
...
<div>
<div class="opac">element 30</div>
</div>
</div>
I'm using chrome 40.0.2214.94 (64-bit) on OSX 10.10.1. Works in Firefox.
The opacity CSS property sets the opacity of an element.
To set the opacity of a background, image, text, or other element, you can use the CSS opacity property. Values for this property range from 0 to 1. If you set the property to 0, the styled element will be completely transparent (ie. invisible).
You have to add the following CSS property to achieve the transparency levels. This sets the background-color of an element to black with 50% opacity. The last value in an rgba value is the alpha value. An alpha value of 1 is equal to 100% opacity, and 0.5 (or .
Transparency using RGBA In addition to RGB, you can use an RGB color value with an alpha channel (RGBA) - which specifies the opacity for a color. An RGBA color value is specified with: rgba(red, green, blue, alpha). The alpha parameter is a number between 0.0 (fully transparent) and 1.0 (fully opaque).
That looks like a rendering bug. For now you can mitigate the effect by applying will-change: opacity
to the parent elements:
.main > div {
overflow-y:auto;
border-radius: 6px;
will-change: opacity;
}
http://jsfiddle.net/yx1cp9f8/
Anther workaround apparently is to set the opacity on the parent element:
<div class="main">
<div class="opac">
<div >element 1</div>
</div>
<div class="opac">
<div >element 2</div>
</div>
...
<div class="opac">
<div >element 30</div>
</div>
Seems to work. (you seem to have forgotten to close your divs, so I did that as well)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With