viewbox
Allows SVG output images to scale beyond the specified width and height.
Syntax
viewbox={value}
Allowed values
Value | Description |
---|---|
1 | Remove explicit width and height properties in the output image in favor of a single viewBox property. |
Notes
- This is useful when you have an SVG that you want rendered using relative sizes as opposed to an explicit width and height (for example, in a flexible layout). Using
viewbox
allows the rendered SVG to scale to fit the dimensions of the parent element on the page. - This parameter only works with
format=svg
. It is ignored when the format is set to anything else.
Examples
Click the link to view the transformed image using a demo Fastly IO service.
Example usage | Description |
---|---|
?format=svg&width=1000&viewbox=1 | Resize the image to 1000px wide and render as an SVG using viewbox |