I'm tring to make a progress bar. Here is the code.
.outer {
overflow: auto;
width: 500px;
height: 300px;
}
.inner {
/* Uncommmet next line, and the border-radius will disappear. */
/* height: 500px; */
}
.progress {
width: 100%;
border-radius: 40px;
height: 80px;
background-color: #f5f7fa;
overflow: hidden;
}
.progress-basic {
background-color: #3890ff;
height: 100%;
width: 100%;
/* Removing the opacity can fix this bug. But why? */
opacity: 0.8;
}
<div class="outer">
<div class="inner">
<div class="progress">
<div class="progress-basic">
</div>
</div>
</div>
</div>
The div.progress
has overflow:hidden
and border-radius:40px
. So the div.progress-basic
should display as if it has border-radius
.
So far everything is OK. But when the scroll bar shows in their parent element(which is div.outer
in this case), the border-radius
just disappears.
My Chrome version is 52.0.2743.116 (64-bit). I also test this bug in Safari and Firefox, there is no problem.
I find a strange solution for this bug. If I remove the opacity in .progress-basic
, everything will work as expected. But I don't know why, and I really need the opacity.
Here is a codepen to show this bug. http://codepen.io/tanbowensg/pen/akZPEb