How do I create dashed line grid paper like pattern in CSS?
My current code draws grid, but my line is not dashed.
background-size: 100px 100px;
background-image: linear-gradient(to right,#f0f0f0 1px,transparent 1px),linear-gradient(to bottom,#f0f0f0 1px,transparent 1px);
background-position: top center;
I’d like to create background like this:
https://www.pixtastock.com/illustration/53928114
2
Answers
You can use background-image with an encoded SVG inside a URL for this. The SVG URL encoder is pretty handy for this. You can develop an SVG then use the stroke-dasharray to make it dashed. Example code below
For the sake of completeness, a CSS only solution without using a SVG.
Just tweak the CSS variables for your need and you are done.
Here’s the fiddle: https://jsfiddle.net/0nt7v9bj/