I just learned how to make a heart using CSS. Instead of giving my heart one plain color, I was attempting to give my heart shape a gradient. However, when I changed my color from pink to #CCFFFF, #FFCCCC it turned my shape into a a diamond. Why did it do this? Can anyone help me turn it back into a heart with the gradient I want to use?
I also changed the height and width from 50 to 200. This doesn’t seem to have any effect on the shape.
Thanks in advance.
https://codepen.io/LayDBug/pen/aagGde
.heart {
position: absolute;
margin: auto;
top: 0;
right: 0;
bottom: 0;
left: 0;
background-color: #CCFFFF, #FFCCCC;
height: 200px;
width: 200px;
transform: rotate(-45deg);
}
.heart::after {
background-color: #CCFFFF, #FFCCCC;
content: “”;
border-radius: 50%;
position: absolute;
width: 200px;
height: 200px;
top: 0px;
left: 25px;
}
.heart::before {
content: “”;
background-color: #CCFFFF, #FFCCCC;
border-radius: 50%;
position: absolute;
width: 200px;
height: 200px;
top: -25px;
left: 0px;
}
div {
background: linear-gradient(#CCFFFF, #FFCCCC)
}