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

CSS

Henrique Zafniksi
Henrique Zafniksi
8,560 Points

Append a triangle svg to a rectangle svg?

I've made a rectangle to be a banner, and I'd like to add an triangle to the left of that rectangle in order to make an arrow.

How could I make, position a triangle or create an element that resembles both of the elements merged, solely with svg?

1 Answer

Colin Bell
Colin Bell
29,679 Points

Just adding a simple polygon element with three points and then grouping the rectangle and polygon together in a g element should do the trick.

Take a look at this jsbin and mess around with it.