Search code examples
csssafaricross-browsercss-gradients

CSS radial gradient for Safari not working


When I use this snippet on Chrome, IE, and Firefox and it works fine! But on Safari it doesn't work.

This issue happens:

enter image description here

.circle-red {
	border: 2px solid;
	border-radius: 51%;
	width: 40px;
	height: 40px;
	background: radial-gradient(ellipse at 80px 40px, rgba(255, 255, 255, 0.75) 10%, rgba(255,255,255,0.5) 32%, rgba(255,255,255,0) 70% ), linear-gradient(160deg, transparent 10%, red 30%);
	background-size: 87.5% 55%, 100% 100%;
	background-repeat: no-repeat;
}
<div class="circle-red"></div>


Solution

  • Try This adding a webkit prefix on your background-size property and on your background gradient value. Here is an example:

    .circle-red {
        border: 2px solid;
        border-radius: 51%;
        width: 40px;
        height: 40px;
        background: radial-gradient(ellipse at 80px 40px, rgba(255, 255, 255, 0.75) 10%, rgba(255,255,255,0.5) 32%, rgba(255,255,255,0) 70% ), linear-gradient(160deg, transparent 10%, red 30%);
       background: -webkit-radial-gradient(ellipse at 80px 40px, rgba(255, 255, 255, 0.75) 10%, rgba(255,255,255,0.5) 32%, rgba(255,255,255,0) 70% ), linear-gradient(160deg, transparent 10%, red 30%);
        background-size: 87.5% 55%, 100% 100%;
    -webkit-background-size: 87.5% 55%, 100% 100%;
        background-repeat: no-repeat;
    }