Creating dashed line objects with CSS after design
2 answers
This will be the css to get this effect:
div{
width: 200px;
height: 200px;
border: 2px dashed black;
margin: 100px;
border-radius: 50%;
}
div:after{
content: ' ';
display: block;
margin: -10px;
width: 215px; height: 215px;
border: 2px dashed black;
transform:rotate(16deg);
border-radius: 50%;
}
+4
source to share
You must use an image for this. Either gif, png, or svg.
While it is technically possible with css using border: dashed and high border radius, I would not recommend it as different browsers have applied dashed borders differently. There is no w3 standard as to how browser renderers should render this. You also need two divs and rotate one of them.
In particular, Firefox and the Android browser will completely fail to show this correctly. For example, when using a corner radius, Firefox will show a solid line (not broken) at the rounded corners.
I recently created a visual css builder that would show this pretty quickly here - try playing with different settings in different browsers.
+2
source to share