Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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:

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

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.