Contents
Why does my svg have so much white space?
This is because inline-block elements (like and ) sit on the text baseline. The extra space you are seeing is the space left to accommodate character descenders (the tail on ‘y’, ‘g’ etc). svg is an inline element. inline elements leave white-space.
Why does my svg have space around it?
The padding is part of your svg image. Use an image editing program (for example Adobe Illustrator, but there are probably good open source alternatives as well) to remove the space. This is not something that you should fix in javascript.
How do I change height width in SVG?
Any height or width you set for the SVG with CSS will override the height and width attributes on the . So a rule like svg {width: 100%; height: auto;} will cancel out the dimensions and aspect ratio you set in the code, and give you the default height for inline SVG.
What does save as.svg mean in illustrator?
When using the Save As… dialog, it will save the artboard-cropped file as filename-01.svg. (note the -01 suffix). I assume you’re checking that file, which means it is likely a bug in AI. Try exporting as an .eps with artboard on, then export that to a .svg.
Is there a way to export SVG in illustrator?
The new option to export SVG code includes improved support for web and mobile workflows, and produces higher quality SVG artwork. New export options—export plain SVG code, which can be easily edited; minified SVG to reduce code size; and unique IDs
How to remove extra vectors from Adobe Illustrator?
Otherwise you may need to remove all vectors outside the artboard manually. Check for stray vectors, and if anything is hanging out over the edge of the artboard, try using the Pathfinder tool to manually crop to the artboard. As a last resort, you can also edit the .SVG file in a code editor as it is XML based.
Do you need to save the.svg file as a copy?
You need to save the .svg as a copy, not go through the File > Scripts > SaveDocsAsSVG option. The save as copy gives you the option to save artboards or not. You can also check the XML code before saving too with this route. Thanks for contributing an answer to Graphic Design Stack Exchange!