How can I set custom SVG icons with CSS on a <ul>
's list items? See below:
<ul>
<li style="list-style-image: url('first.svg')">This is my first item</li>
<li style="list-style-image: url('second.svg')">And here's my second</li>
</ul>
The issue I'm facing is that the images are too large and stretch the height of the lines. I want to avoid changing the image size as SVG images are meant to scale with resolution. Is there a way to adjust the image size using CSS without resorting to a background-image
hack?
UPDATE: Check out this preview (I purposely chose a large image for illustration): http://jsfiddle.net/tWQ65/4/
Also, here's my current workaround using CSS3's background-size
: http://jsfiddle.net/kP375/1/