From the course: Learning SVG

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Clean SVG files for web publishing

Clean SVG files for web publishing - SVG Tutorial

From the course: Learning SVG

Start my 1-month free trial

Clean SVG files for web publishing

- [Instructor] At this point, we have an accessible SVG that looks the way we want it to. But it's not quite ready for the production process yet. Before we can add this SVG into a production environment, where we then optimize it further and include it into a site we need to improve the code quality, and make sure everything is working properly. As I've explained before, when Illustrator generates SVG codes, it adds a bunch of extra stuff we don't need. So the first step is to remove all that stuff so we get a nice clean SVG markup. Off the top, we'll take away the XML declaration. It's not necessary. We'll leave the version number and XML name space in place, but take away the XML Xlink reference. I also don't need the X and Y attributes. I'll leave width, height, and viewBox, but take away style and XML space. And then finally, we have the aria-labelledby and aria-describedby, which help us with accessibility, so they will also be left in place. Now, whether or not you want to…

Contents