SVG icon pixel-alignment?

那年仲夏 提交于 2019-12-14 02:11:32

问题


In this image, the left (black) trash can is an icon-font. Its font-size is 16px which causes the icon to look crisp 100% of the time.

The two blue trash cans are SVGs. They have exactly the same markup. One of them happened to be pixel-aligned, and the other one wasn't.

How can I force my SVG icons to always be pixel-aligned so that they come out sharp, just like font-icons?

Not that I think it's relevant to my question, but the icon in question is ionicon trash-a.svg. It was designed to look crisp at particular sizes, but I'm pretty sure the browser isn't pixel-aligning it depending on where it lands in a paragraph.

来源:https://stackoverflow.com/questions/42081449/svg-icon-pixel-alignment

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!