Use muliple background like below:
.plus {
display:inline-block;
width:50px;
height:50px;
background:
linear-gradient(#fff,#fff),
linear-gradient(#fff,#fff),
#000;
background-position:center;
background-size: 50% 2px,2px 50%; /*thickness = 2px, length = 50% (25px)*/
background-repeat:no-repeat;
}
.alt {
background:
linear-gradient(#000,#000),
linear-gradient(#000,#000);
background-position:center;
background-size: 50% 2px,2px 50%; /*thickness = 2px, length = 50% (25px)*/
background-repeat:no-repeat;
}
.radius {
border-radius:50%;
}
And here is with transparency:
.plus {
width:50px;
height:50px;
display:inline-block;
background:
linear-gradient(#000,#000) top left,
linear-gradient(#000,#000) top right,
linear-gradient(#000,#000) bottom left,
linear-gradient(#000,#000) bottom right;
background-size: calc(50% - 1px) calc(50% - 1px); /*thickness = 2px (2*1px) */
background-repeat:no-repeat;
border:10px solid #000; /*length = 30px (50px - 2x10px) */
box-sizing:border-box;
}
.radius {
border-radius:50%;
}
body {
background:pink;
}
We can add CSS variable to easily control the overal shape:
.plus {
--t:2px; /* Thickness */
--l:40px; /* size of the symbol */
--s:10px; /* space around the symbol */
--c1:#fff; /* Plus color*/
--c2:#000; /* background color*/
display:inline-block;
width:var(--l);
height:var(--l);
padding:var(--s);
box-sizing:border-box; /*Remove this if you don't want space to be included in the size*/
background:
linear-gradient(var(--c1),var(--c1)) content-box,
linear-gradient(var(--c1),var(--c1)) content-box,
var(--c2);
background-position:center;
background-size: 100% var(--t),var(--t) 100%;
background-repeat:no-repeat;
}
.radius {
border-radius:50%;
}