i wanted to make the background line a dashed wavy line tried using div with border-style: dashed and border-radius, but couldn't achieve it. how to make this marked line (refer to attached image) as background in CSS.
-
I am not sure if you can achieve this with plain CSS. I would use SVG as background image.Jax-p– Jax-p2021-11-22 08:36:07 +00:00Commented Nov 22, 2021 at 8:36
-
@Jax-p okay thanks for your quick response .Ramusesan– Ramusesan2021-11-22 08:37:18 +00:00Commented Nov 22, 2021 at 8:37
-
You might be able to achieve using an element with a radius and some elements to "cover" it so it will "cut" and hide the other part of the circle, but that route is quite hacky.I am L– I am L2021-11-22 08:52:13 +00:00Commented Nov 22, 2021 at 8:52
3 Answers
The only thing that I can think about (without having javascript/svg and just pure html and css) is to combine border-style: dashed, border-radius and a couple of "cover" elements to "cut" and hide the radial elements.
check this one. https://jsfiddle.net/fco0v79p/1/ (just need to proper position it to make it flawless)
Although I'm warning you that this is quite hacky, tedious, and inflexible.
Comments
I think this is not done by CSS. it is probably SVG or PNG.
here is the link to PNG you can use => wave.png
If you want to do it with CSS maybe you can use the code below. (but with straight lines for less problem)
/* just setting up background*/
*{
margin:0;
padding:0;
}
.parent-dashed{
background-color:#181A2F;
height:100vh;
width:100%;
}
/* main css */
.dashed{
width:200px;
border:none;
border-bottom:10px dashed #e7e7e7;
position:absolute;
}
/* position lines where you want */
.line1{
top:35%;
transform:rotate(3deg);
}
.line2{
top:30%;
right:0;
transform:rotate(-3deg);
}
.line3{
top:80%;
right:0;
transform:rotate(5deg);
width:500px;
}
<div class='parent-dashed'>
<div class='dashed line1'></div>
<div class='dashed line2'></div>
<div class='dashed line3'></div>
</div>
