Skip to content

Instantly share code, notes, and snippets.

@vbarbarosh
Last active June 9, 2019 17:39
Show Gist options
  • Select an option

  • Save vbarbarosh/4a6aa6f1f6784322ac5d5477da4c5f2c to your computer and use it in GitHub Desktop.

Select an option

Save vbarbarosh/4a6aa6f1f6784322ac5d5477da4c5f2c to your computer and use it in GitHub Desktop.
svg_pattern_grid – Drawing a 10x10 grid by 100x100 outline https://codescreens.com
Display the source blob
Display the rendered blob
Raw
<svg xmlns="http://www.w3.org/2000/svg">
<!-- Drawing a 10x10 grid by 100x100 outline -->
<!-- https://codepen.io/vbarbarosh/pen/oRJRey -->
<!-- <img src="svg_pattern_grid.svg" width="401" height="401"> -->
<defs>
<!-- http://stackoverflow.com/a/14209704 -->
<pattern id="subgrid" width="10" height="10" patternUnits="userSpaceOnUse">
<path d="M 10 0 L 0 0 0 10" fill="none" stroke="gray"
stroke-width="0.5" />
</pattern>
<pattern id="grid" width="100" height="100" patternUnits="userSpaceOnUse">
<path d="M 100 0 L 0 0 0 100" fill="none" stroke="gray"
stroke-width="1" />
<rect width="100" height="100" fill="url(#subgrid)" />
</pattern>
</defs>
<rect width="100%" height="100%" fill="url(#grid)" />
</svg>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment