Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Development Tools Introduction to Front End Performance Optimization Combine and Minify Assets Create a Sprite Map

1 Answer

What Nick did

First he combined all svg into one single svg container

this saves the opening and closing svg tags (not much but it saves a little bandwidth)

Then he put this big svg element into every html document

this saves a little bit of bandwidth (no extra HTTP request), but it cost much more memory because the svgs are implemented for every site which is not efficient

Finally he removed the svgs out of the svg element which are not used for this site

this is memory efficient

In the html doc he used:

<svg>
    <use xlink:href="#twitter" />
</svg>

The svg element indicates that this is an svg. The use element looks for a svg that is already used with the specified class in a symbol element inside of a svg element;

Nicholas Wallen
Nicholas Wallen
12,278 Points

Yes, but if there is a pre-existing course which we should be taking prior to this which explains all the syntax behind SVGs, then he should state that. Within this track, this video has zero context.