#div,svg{
height:40vh;
width:90vw;
border:solid;
margin:.5em;
}
#div{
background:linear-gradient(0deg, rgba(255,0, 0 ,.8), rgba(255,0, 0 ,0)),
linear-gradient(90deg, rgba(0,255,0,.8), rgba(0,255, 0 ,0))
}
<div id="div"></div>
<svg viewBox="0 0 100 100" preserveAspectRatio="none">
<linearGradient id="lg1" y1="100%" y2 = "0%" x2="0%">
<stop offset = "0%" stop-color = "rgba(255,0, 0 ,.8)" />
<stop offset = "100%" stop-color = "rgba(255,0, 0 ,0)" />
</linearGradient>
<linearGradient id="lg2" x1="0%" x2 = "100%" >
<stop offset = "0%" stop-color = "rgba(0,255, 0 ,.8)" />
<stop offset = "100%" stop-color = "rgba(0,255, 0 ,0)" />
</linearGradient>
<rect width="100" height="100" fill="url(#lg2)"/>
<rect width="100" height="100" fill="url(#lg1)"/>
</svg>