Here is the jsfiddle:
Codes pasted below:
.cover {
background: linear-gradient(to bottom, rgb(0,0,255,0.5), rgb(238,130,238,0.5));
background: -webkit-linear-gradient(top, rgb(0,0,255,0.5), rgb(238,130,238,0.5));
bottom: 0;
top: 0;
left: 0;
right: 0;
z-index: 99999;
position: absolute;
}
<h2> I'm bottom</h2>
<div class="cover"></div>
As can be seen in the demo, the cover doesn't display at all. If I change the rgb(0,0,255,0.5)
to rgb(0,0,255)
, the cover can show, but it loses the transparency..
Does anyone have ideas about how to keep transparency as well as gradient?
Use
RGBA
insteadhttp://jsfiddle.net/txj54fL9/1/