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
James Hollingworth
3,662 PointsAdd SVG to a page
How do you put an svg into a ul li? Can anyone kindly help?
<nav>
<ul>
<li><a href="#" title="Home">Home</a></li>
<li><a href="#" title="About">About</a></li>
<li>
<object class="logo" data="img/logo.svg" type="image/svg+xml"></object>
</li>
<li><a href="#" title="Work">Work</a></li>
<li><a href="#" title="Contact">Contact</a></li>
</ul>
</nav>
7 Answers
Spen Taylor
13,027 PointsHeres how some code for an SVG look from the header of the site I'm currently working on.
<object data="media/Logo70.svg" type="image/svg+xml" class="headerlogo"></object>
This wrapped in a <li> tag should work, just swap out the "data" and get rid of/ change the "class".
James Hollingworth
3,662 Points<nav> <ul> <li><a href="#" title="Home">Home</a></li> <li><a href="#" title="About">About</a></li> <li><object class="logo" data="img/logo.svg" type="image/svg+xml"> </object> </li> <li><a href="#" title="Work">Work</a></li> <li><a href="#" title="Contact">Contact</a></li> </ul> </nav>
James Hollingworth
3,662 Points<nav> <ul> <li><a href="#" title="Home">Home</a></li> <li><a href="#" title="About">About</a></li> <li><object class="logo" data="img/logo.svg" type="image/svg+xml"> </object> </li> <li><a href="#" title="Work">Work</a></li> <li><a href="#" title="Contact">Contact</a></li> </ul> </nav>
Chase Lee
29,275 PointsYou can display code by wrapping it in " `` ".
James Hollingworth
3,662 Points" "<nav>
<ul>
<li><a href="#" title="Home">Home</a></li>
<li><a href="#" title="About">About</a></li>
<li><object class="logo" data="img/logo.svg" type="image/svg+xml"> </object> </li>
<li><a href="#" title="Work">Work</a></li>
<li><a href="#" title="Contact">Contact</a></li>
</ul>
</nav>
" "
James Hollingworth
3,662 PointsThanks Chase. that really helped
James Hollingworth
3,662 PointsExcellent thanks!
Daniel Lewis
1,437 PointsDaniel Lewis
1,437 PointsMoved this thread to the HTML topic. Just a reminder that questions posed in General Discussion can not be marked with a best answer.