Embedding an SVG into a dropdown menu

2019-05-18 00:27发布

问题:

I haven't found any ways, but I was wondering if there is a way to embed an SVG into a dropdown menu. I've got one SVG already in my HTML and can't seem to even get a dropdown functioning, yet when I write all the JS in something like the 'Tryit Editor' on W3, everything functions but I lack the ability to add the SVG I need to add.

    <svg height="100%" width="100%">
      <defs>
        <linearGradient id="grad3" x1="0%" y1="0%" x2="0%" y2="100%">
          <stop offset="0%" style="stop-color:rgb(0, 96, 45);stop-opacity:1" />
          <stop offset="100%" style="stop-color:rgb(0, 172, 68);stop-opacity:1" />
        </linearGradient>
      </defs>
      <rect width="930" height="340" fill="url(#grad3)" />
    </svg>

There's my SVG code if that helps.

Thanks in advance!