#diamond{
width: 40px;
height: 40px;
transform: rotate(45deg);
background: red;
}
<html>
<body>
<div id="diamond"></div>
</body>
</html>
I'm trying to create a diamond shape with css. However, the diamond that I want to create is not made up of straight lines, but four slightly concave lines, like the bicycle cards. Is it possible to concave a straight line in css?
I believe a simple
<svg>
path is the way to go here. A clear advantage is displaying it inline, as a normal letter:Note I added some JS and a slide input to allow changing font-size dynamically. They're not part of the actual answer.
Here is an idea using
radial-gradient
but without transparency:You can also easily do this with SVG:
To edit the shape :
http://jxnblk.com/paths/?d=M0 32 C20 44 20 44 32 64 C44 44 44 44 64 32 C44 20 44 20 32 0 C20 20 20 20 0 32 Z