Best / shortest way to draw a 1px grid in SVG

I need to draw a 1px grid (10px spacing) using the SVG canvas embedded in the web page. There are many SVG tags to choose from, and I was hoping that someone could guess which tags would be best for the job and get the least amount of code.

For example, is there a shorter alternative to building a path using the <path> tag? Perhaps by defining a square of 10px x 10px, then somehow repeating it over the canvas.

In any case, please open the offers.

thank

+3
source share
2 answers

You can make <pattern>(essentially a tile in your question) and fill out any form with this.

.

+4

( 3!), , Google Google , 1. , :

<rect x="86" y="61" width="1" height="198" stroke="none" stroke-width="0" fill-opacity="1" stroke-opacity="1" stroke-dasharray="0" fill="#cccccc"></rect>

? . , -, -, . , , "h" "v" . , .

0

All Articles