0

After creating a custom SVG with shapes and text, the big code is left:

    <a href="..." target="_blank">
      <svg id="svg-1" width="120px" height="120px" version="1.1" ...>
        50 lines of code...
      </svg>
    </a>

How could one create a simple code which can someone copy and paste on a website? Is it possible?

I have tried to compress the svg and the code is still huge. Also, I have tried to convert the svg into png and the code was even longer by doing that.

Dario Sagud
  • 81
  • 1
  • 8
  • It sounds as though your SVG itself is longer than you'd like. I expect it can be shortened so why not paste it into your question so we can advise? Other than that, 50 lines is not really what I would call 'huge', so perhaps I'm not understanding why you'd like people to cut and paste it. Usually I'd be concerned about file size and code clarity rather than length. – MSC Jan 20 '19 at 21:31
  • You may put the 50 lines of code inside a `` element with an `id` and this `` inside a `` element. Put the `#svg-1` at the top of the body and let it be `width="0" height="0"` Then when you need the svg image you create another svg element and inside this svg you `` the `` element, To do this you need only one line of code. – enxaneta Jan 20 '19 at 22:12

0 Answers0