I had a perfectly valid (judging by the look) radial gradient :
.square {
background-color: #f0d9b5;
color: #b58863;
width: 80px;
height: 80px;
float: left;
position: relative;
}
.grad:after {
content: '';
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
background: #00f;
background: -webkit-radial-gradient(center center,circle cover,rgba(0,0,255,1),rgba(255,255,255,0)100%);
background: radial-gradient(center center,circle cover,rgba(0,0,255,1),rgba(255,255,255,0)100%);
background: -ms-radial-gradient(center center,circle cover,rgba(0,0,255,1),rgba(255,255,255,0)100%);
}
<div class="square grad"></div>
I had no problem with it, till I found that all these prefixes are not needed for a gradient.. Removing them actually removes the gradients in corresponding browsers. It looked like the problem is that there is another (newer) syntax for css gradient.
The problem is that if change my background to:
background: radial-gradient(circle at 50% 50% , #00f 0%, #fff 100%);
the result looks different:
.square {
background-color: #f0d9b5;
color: #b58863;
width: 80px;
height: 80px;
float: left;
position: relative;
}
.grad-first:after {
content: '';
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
background: #00f;
background: -webkit-radial-gradient(center center,circle cover,rgba(0,0,255,1),rgba(255,255,255,0)100%);
background: radial-gradient(center center,circle cover,rgba(0,0,255,1),rgba(255,255,255,0)100%);
background: -ms-radial-gradient(center center,circle cover,rgba(0,0,255,1),rgba(255,255,255,0)100%);
}
.grad-second:after {
content: '';
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
background: #00f;
background: radial-gradient(circle at 50% 50% , #00f 0%, #fff 100%);
}
<div class="square grad-first"></div>
<div class="square grad-second"></div>
Which looks like it is removing my first background on .square
. How can this be changed?