Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Scalable Vector Graphics isn’t a new format: The W3C started work on it in 1999. The
consortium recommends the use of SVG 1.1 (since 2001), as version 1.2 is still a working draft.
Adobe was deeply involved in the development of SVG back in the days. The Adobe SVG Search for:
Viewer is a very advanced plugin that supports most of the SVG specification. However, Search
Adobe discontinued the support for the SVG Viewer 4 years ago.
Today, SVG 1.1 is supported by the vast majority of web browsers, on the desktop and mobile
devices. It works everywhere except IE 8 (and down) and Android 2.3 (and down). The rebirth Recent Posts
of SVG is a consequence of the rise of mobile devices and the introduction of different screen
densities. Vector graphics can be very interesting for designers who need to display icons,
symbols or logos that will look great on all screens, including retina displays. SVG graphics Adobe Muse Tips: Fading
http://creativedroplets.com/export-svg-for-the-web-with-illustrator-cc/ Page 1 of 23
Export SVG for the web with Illustrator CC | Creative droplets 12/02/2018, 12(01
naturally scale and are usually small and automatically compressed by web HTTP servers rollovers on images
(using automatic gzip compression).
Adobe Muse Tips: Add a
Adobe Illustrator CC is the software of choice for designing vector graphics. In this post, shopping cart with Paypal
I’ll cover the best export options to produce quality SVG files for your websites, with the
Adobe Muse Tips: Share on
smallest file size possible.
Facebook
To export SVG files from Illustrator, you need to choose File > Save As. Indeed, a SVG file is
just an XML file, and Illustrator can store inside private information to edit the file later on. It’s
a way to save a full Illustrator file in XML (another use case for SVG).
Notice the “Use Artboards” options in the Save As dialog box. If you have designed 10
symbols in your Illustrator file, you can use this option to easily create one artboard per
symbol, and output 10 SVG files (one per symbol) in a single operation. If you are not familiar
with artboards in Illustrator, check this article about Illustrator files in the Creative Cloud: I
explain how to create artboards that will automatically fit your content.
http://creativedroplets.com/export-svg-for-the-web-with-illustrator-cc/ Page 2 of 23
Export SVG for the web with Illustrator CC | Creative droplets 12/02/2018, 12(01
The panel and the options I use to export SVG for the web
http://creativedroplets.com/export-svg-for-the-web-with-illustrator-cc/ Page 3 of 23
Export SVG for the web with Illustrator CC | Creative droplets 12/02/2018, 12(01
The best option is SVG 1.1 as it’s the version recommended by the W3C. SVG Tiny was created
a long time ago to support the first generation of mobile devices such as Blackberry phones
andPDAs. Today, it doesn’t make sense to export SVG Tiny files if you target smartphones.
By default, Illustrator selects Adobe CEF, which is the best font format for the Adobe SVG
Viewer. Web designers must select the type “SVG”, to enable the font format defined by
the W3C.
With SVG, you can save a subset of glyphs within the document. This will, of course, increase
the size of your SVG file, but it’s a nice way to embed a font. If you don’t plan to dynamically
change the text content of your SVG, you can select “Only glyphs used”. Illustrator will detect
and embed the characters used in your document.
The third option, “Convert to outline”, can be useful if you don’t want to automatically convert
your text content into SVG paths. This can be used for an icon with a few characters such as
“Home”, or “Info”.
The file size difference between a subset of glyphs and converted fonts to SVG paths is not
significant.
However, if you use complex fonts (such as handwriting fonts), it will dramatically increase
the size of your SVG file. Also, if you scale down to much a font converted to outlined paths,
you may lose some visual fidelity (but that’s just in theory, I cannot detect a clear difference in
modern browsers).
EDIT:
Some SVG experts told me that SVG fonts are not fully supported by Firefox and IE, and
they don’t plan to support it. So, if you don’t want to convert your fonts to outline, you should
use web fonts. “Convert to outline” can blow up your SVG files and make them less accessible.
http://creativedroplets.com/export-svg-for-the-web-with-illustrator-cc/ Page 4 of 23
Export SVG for the web with Illustrator CC | Creative droplets 12/02/2018, 12(01
That’s why web fonts are a better option. If you are looking for a set of free web font, check
the Adobe Edge Web Fonts, which is a free subset of Typekit.
Check this sample in which I’ve embedded a classic font (Adobe Clean), and a more complex
one (ChalkDust).
Click on the image to test this sample and resize your window.
Image options
You can choose between embedding the images (bitmaps) within the SVG file, or as a link to
an external resource. Here is how it translates in SVG:
EMBED
http://creativedroplets.com/export-svg-for-the-web-with-illustrator-cc/ Page 5 of 23
Export SVG for the web with Illustrator CC | Creative droplets 12/02/2018, 12(01
18 </image>
19 </svg>
LINK
Web designers will quickly understand that it requires some cleaning up The link to an
external resource is obviously the best option, but the relative link is weird as it points to
the original file on your hard disk. Also, if Illustrator decides to output a JPEG file, you cannot
control the compression.
The best way to proceed is to use the LINK option, and then modify the href parameter to
point to your own image file, which you compress with Photoshop CC.
Editing capabilities
As I noted previously, SVG can be used as a way to save your Illustrator creations. By adding
private information in the XML, Illustrator can save editing parameters in the file. All this
information is obviously useless for the web, and tha leads to a common mistake. I’ve met
web designers who criticized the file size of SVG graphics produced with Illustrator. In all
cases, it was because they had not disabled the “Preserve Illustrator Editing capabilities”
option. Here is the difference in file size for a simple SVG file that is just a rectangle:
The advanced options unveiled by clicking the “More Options” button are critical for web
designers. It enables key optimization tricks to reduce the size of your SVG files.
By the way, notice the two buttons “SVG Code” and “Browser Preview”. These let you play with
http://creativedroplets.com/export-svg-for-the-web-with-illustrator-cc/ Page 6 of 23
Export SVG for the web with Illustrator CC | Creative droplets 12/02/2018, 12(01
the export options, and preview your result before pushing the Save button.
Decimal Places
Precision
This parameter is useful to define the precision of vectors exported. Considr the following
simple “moon” shape.
Naturally, the first export produces more precise vector coordinates. But SVG is very verbose,
and generating 7 decimal numbers will produce heavy files.
This setting theoretically affects the quality of your graphics, but can you really see the
difference? Let’s try with a more complex SVG, the portrait of Napoleon.
Try to see a visual difference between these 2 SVG files. Click on the image to test it.
In this sample, I’m displaying the same artwork exported with a decimal place setting of 7 and
then 1. Honestly, can you see a difference? The big difference resides in the file sizes: 31Kb vs.
http://creativedroplets.com/export-svg-for-the-web-with-illustrator-cc/ Page 7 of 23
Export SVG for the web with Illustrator CC | Creative droplets 12/02/2018, 12(01
12.7Kb.
The Warp tool (Shift+R) molds objects with the movement of the cursor (like molding clay, for example).
As a designer, I like the Warp tool because it gives me the freedom to draw and respect the
energy of my artwork. It’s a manual operation though.
http://creativedroplets.com/export-svg-for-the-web-with-illustrator-cc/ Page 8 of 23
Export SVG for the web with Illustrator CC | Creative droplets 12/02/2018, 12(01
You can also trust an Illustrator algorithm and use the “Simplify” process. It’s in the Object >
Path > Simplify menu. What I don’t like with “Simplify” is that it’s “all or nothing”. With the
Warp tool, I can decide which part of my drawing I want to simplify, and where I want to keep
some details.
If you plan to add details, or simplify very specific areas of your work, you can rely on the
Pencil tool. Pressing ALT will activate the Smooth tool and enable the most precise way to
reduce the number of points on a specific curve.
Don’t select the “Optimize for Adobe SVG Viewer” option. SVG is supported by default in all
browsers, without any Adobe plugin.
tspan
If your SVG artwork contains a lot of text, this option can dramatically reduce the size of your
exported SVG. In this sample, I’ll just write ‘Adobe’ and export it without checking this option:
http://creativedroplets.com/export-svg-for-the-web-with-illustrator-cc/ Page 9 of 23
Export SVG for the web with Illustrator CC | Creative droplets 12/02/2018, 12(01
Illustrator CC generated two <tspan> elements. One for the capital “A”, and another one
for “dobe”. It’s because the Myriad-Roman applies a specific kerning for the uppercase
letters.
Text is problematic in SVG because it’s hard to have a perfect translation from CoolType to
SVG without selecting particular glyphs. Adding <tspan> elements does the trick, but you’ll
lose the semantic meaning.
If you check the box, Illustrator CC will ignore the kerning positions and create one tspan:
It reduces the size of the SVG and if you plan to dynamically modify the text thanks to
JavaScript code, it will be easier.
Same as above, my advice is to leverage the <textPath> SVG element, so check this box.
Otherwise, it will declare one <tspan> per character.
FREE TIP FROM 2002: Notice the startOffset parameter and play with it in JavaScript, if you
want to create a cheesy animation.
http://creativedroplets.com/export-svg-for-the-web-with-illustrator-cc/ Page 10 of 23
Export SVG for the web with Illustrator CC | Creative droplets 12/02/2018, 12(01
I invite you to select the option “Style Elements” which has been designed for the web. The
other ones are more for pure XML processing (with XSLT for instance). If you don’t plan to
modify your SVG code after export, select the default option “Presentation Attributes”.
Illustrator CCwill detect the graphic styles of your artwork and translate them into
CSS properties at the top of the document, so that you can easily style your SVG afterwards.
Naming is preserved for layers and objects styles. Look at this sample:
Two layers
I’ve also defined two graphic styles: sandStyle (already applied to the two shapes), and
blueSky.
In the SVG export options, I select “Style Elements”, and I check “Include Unused Graphic
Styles”. It will declare “sandStyle” and “blueSky” as CSS styles in the SVG document. Here is the
SVG output generated by Illustrator CC:
1 <style type="text/css">
2 .sandStyle{fill:#BFAF8F;stroke:#A6806A;stroke-width:3;stroke-miterlimit:10;
}
3 .blueSky{fill:#338AC4;stroke:#3469B7;stroke-width:3;stroke-miterlimit:10;}
4 </style>
5 <g id="mySquare">
6 <rect x="90.5" y="15.5" class="sandStyle" width="64" height="63"/>
7 </g>
8 <g id="myCircle">
9 <circle class="sandStyle" cx="42" cy="46" r="34.2"/>
10 </g>
The code is well structured and you can easily modify your styles afterwards or dynamically
http://creativedroplets.com/export-svg-for-the-web-with-illustrator-cc/ Page 11 of 23
Export SVG for the web with Illustrator CC | Creative droplets 12/02/2018, 12(01
apply new styles to your elements using JavaScript. Notice the name of the layers “mySquare”
and “myCircle” correctly preserved in the SVG. If you want to play with this sample in your
browser, click here.
Requests / Feedback ?
If you need more features in Illustrator CC to export quality SVG files for the web, now is the
perfect time to give us feedback. Please post a comment, and I’ll make sure that the
Illustrator team considers your feedback. Thanks!
Related Posts
HTML5 and Multitouch – Transparent PNG with Adobe apps and Web
Hammer.js Illustrator Design
45 Comments
Reply
http://creativedroplets.com/export-svg-for-the-web-with-illustrator-cc/ Page 12 of 23
Export SVG for the web with Illustrator CC | Creative droplets 12/02/2018, 12(01
So, is there any way to get character / paragraph styles applied as classes like
you can do with graphic styles? It’d be a thousand times better than the stX styles
that get auto-generated, and we could more easily export and style SVGs for
various environments without doing it all in illustrator.
Reply
Reply
Reply
The “Adobe Clean Font – embed glyph” renders like Times New Roman, while the
more complex “Chalkduster font – Embed glyphs” renders perfectly. Thought this
was an interesting and unexpected result and wanted to share for anyone who
might be interested.
Again, great write-up and great tips along the way for optimizing file sizes!
Reply
Reply
http://creativedroplets.com/export-svg-for-the-web-with-illustrator-cc/ Page 13 of 23
Export SVG for the web with Illustrator CC | Creative droplets 12/02/2018, 12(01
Reply
Reply
Reply
http://creativedroplets.com/export-svg-for-the-web-with-illustrator-cc/ Page 14 of 23
Export SVG for the web with Illustrator CC | Creative droplets 12/02/2018, 12(01
Reply
Reply
Reply
Reply
Reply
http://creativedroplets.com/export-svg-for-the-web-with-illustrator-cc/ Page 15 of 23
Export SVG for the web with Illustrator CC | Creative droplets 12/02/2018, 12(01
Reply
Reply
Reply
Reply
http://creativedroplets.com/export-svg-for-the-web-with-illustrator-cc/ Page 16 of 23
Export SVG for the web with Illustrator CC | Creative droplets 12/02/2018, 12(01
sentence.
I’ve been trying to find a way around this for months and haven’t found a
solution yet other than converting to outline – but that’s not an option for my
scenario.
Is anyone else aware of this?
Reply
Reply
Reply
My only gripe is that AI CS6 will strip classes defined outside of illustrator.
Externally declared ID’s are preserved when saving in AI.
Reply
Reply
http://creativedroplets.com/export-svg-for-the-web-with-illustrator-cc/ Page 17 of 23
Export SVG for the web with Illustrator CC | Creative droplets 12/02/2018, 12(01
Very annoying!
Reply
Reply
Thanks
Reply
Thanks
Reply
// correct gradient
http://creativedroplets.com/export-svg-for-the-web-with-illustrator-cc/ Page 18 of 23
Export SVG for the web with Illustrator CC | Creative droplets 12/02/2018, 12(01
————————————
.testStyle{fill:url(#testrect_1_);}
// correct gradient
When i change the code by myself, it works properly. But it’s actually
no option to change every svg by hand…
Do you have any ideas what’s happening there and how to possibly
avoid it?!
Thanks in advance,
Flo
Reply
Reply
I’m facing a problem with the TextField properties, specially the text-align one.
Is there any way to export text-alignment property in svg file ? (right, or
centered).
P.
Reply
Reply
Reply
http://creativedroplets.com/export-svg-for-the-web-with-illustrator-cc/ Page 19 of 23
Export SVG for the web with Illustrator CC | Creative droplets 12/02/2018, 12(01
How can I export circles not as but as ? I want to do some tween animation after
export using JavaScript so I need paths to be used.
Reply
Reply
(2) You advise linking rather than embedding the image, but Illustrator’s own
tool-tip for the “Link” option says that linked artwork will be saved in either .jpg
or .png format. How do .jpg and .png bitmaps become infinitely scalable vector
artwork — the whole point of SVG? Is the vector artwork being generated on the
fly with the .png/.jpg serving as a thumbnail preview per .eps? Is there really any
increase in quality and speed, or are we just trading the time it takes to load
larger embedded files for the time it takes to generate vector artwork on the fly?
Reply
cheers, Mark
Reply
We have technical drawings. Our problem is that we need to replace some texts
with localized dimensions.
The resulting text-width varies per locale.
As all text-blocks are converted to left-aligned, the dimensions do no longer line
http://creativedroplets.com/export-svg-for-the-web-with-illustrator-cc/ Page 20 of 23
Export SVG for the web with Illustrator CC | Creative droplets 12/02/2018, 12(01
Reply
Reply
Reply
Reply
Thanks
Reply
To fix this I open each SVG in a text editor and find and replace the -Bold with a
font weight.
font-family=”‘Calibri'” font-weight=”‘bold'”
Reply
http://creativedroplets.com/export-svg-for-the-web-with-illustrator-cc/ Page 21 of 23
Export SVG for the web with Illustrator CC | Creative droplets 12/02/2018, 12(01
I design web icons and these settings are exactly what I needed for the SVG
export I do. Very helpful and extensive article.
Reply
I am however having issues when converting a file that has some gradient
shading. It seems like gradients are totally stripped and the image turns out
looking pretty bad. Has anyone else managed to conquer the SVG gradient
export from Illustrator CC yet?
Reply
I want Illustrator to preserve at least one “backup” alternative font in case the
one I pick isn’t available on someone else’s browser (i.e., I want it to generate
font-family=”DejavuSans”, sans-serif), and I want to preserve my font sizes using
the em scale rather than the point scale (e.g., font-size=3em rather than font-
size=42px). Near as I can tell, Illustrator won’t do either of those things. Please
tell me I am wrong…?
Reply
Trackbacks/Pingbacks
Best of JavaScript, HTML & CSS – Week of July 15, 2013 | Flippin' Awesome - [...] Michael
Chaize covers the best export options in Illustrator that produce quality SVG files with the
smallest file size…
Exportar SVG | DSÑ + IEO * GRFC + ÁIO - [...] dejar por defecto todos los valores hasta que el
otro día me encontré con este artículo Export SVG for…
SVG-изображения: используем векторную графику в веб-дизайне - […] Болеее подробно
про экспорт SVG из Adobe Illustrator версий CS6 и CC можно прочитать на блоге
creativedroplets.com. […]
Sử dụng định dạng SVG cho ứng dụng web của bạn | Sentudio.Com - […] will present you an
SVG options dialog. There’s a really complete guide for these settings on Creative Droplets
but…
Live blog 25 years of Adobe Illustrator in Amsterdam AUGNL » Clasener - […] Creating svg files
for the web is extremely powerful, once done correctly. Check out Michael’s blog. […]
VirtuallyGeeky's Blog | Retina display goodness… ruined by low res images on the web - […]
earlier than IE9 on a Windows PC, but I suppose only time (and stats) will tell. It looks like…
A Compendium of SVG Information | Lunarium Design - […] Exporting SVG for the web with
Adobe Illustrator CC by Michaël Chaize […]
The Best SVG Tutorials and TechniquesFree Internet Tutorials | Free Internet Tutorials - […]
View Tutorial […]
Styling And Animating SVGs With CSS | Smashing Magazine - […] The reasons why the options
above are best are explained in Michaël Chaize’s excellent article “Export SVG for the…
Styling And Animating SVGs With CSS - rehavaPress - […] The reasons why the options above
are best are explained in Michaël Chaize’s excellent article “Export SVG for the…
Styling And Animating SVGs With CSS | Bastudio - […] The reasons why the options above are
best are explained in Michaël Chaize's excellent article “Export SVG for the…
Styling And Animating SVGs With CSS - Sacked Articles | Sacked Articles - […] The reasons why
the options above are best are explained in Michaël Chaize’s excellent article “Export SVG for
the…
Styling And Animating SVGs With CSS | endlessness - […] The reasons why the options above
are best are explained in Michaël Chaize’s excellent article “Export SVG for the…
Styling And Animating SVGs With CSS - InfoLogs - […] The reasons why the options above are
best are explained in Michaël Chaize’s excellent article “Export SVG for the…
SVG с помощью CSS - Часть 1 - Zencoder - […] Почему представленный выбор настроек
является наилучшим, рассказано Michaël Chaize в прекрасной статье Export SVG for the
Web With Illustrator…
http://creativedroplets.com/export-svg-for-the-web-with-illustrator-cc/ Page 22 of 23
Export SVG for the web with Illustrator CC | Creative droplets 12/02/2018, 12(01
Submit a Comment
Your email address will not be published. Required fields are marked *
Comment
Name *
Email *
Website
Submit
Social
http://creativedroplets.com/export-svg-for-the-web-with-illustrator-cc/ Page 23 of 23