The creator of SVG content might want to provide a hint about what tradeoffs to make as the browser renders <path> element or basic shapes. The shape-rendering attribute provides these hints.
| Categories | Presentation attribute |
|---|---|
| Value | auto | optimizeSpeed | crispEdges | geometricPrecision | inherit |
| Animatable | Yes |
| Normative document | SVG 1.1 (2nd Edition) |
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="100" height="100" shape-rendering="optimizeSpeed">
| shape-rendering: geometricPrecision | shape-rendering: optimizeSpeed |
Similarly, you can use css shape-rendering:
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="100" height="100" style="shape-rendering:optimizeSpeed;">
The following elements can use the shape-rendering attribute
| Desktop | ||||||
|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | |
| Basic support | ? | ? | ? | ? | ? | ? |
| Mobile | |||||||
|---|---|---|---|---|---|---|---|
| Android webview | Chrome for Android | Edge Mobile | Firefox for Android | Opera for Android | iOS Safari | Samsung Internet | |
| Basic support | ? | ? | ? | ? | ? | ? | ? |
© 2005–2018 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/shape-rendering