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.

HTML SVG Basics Introduction to SVG Create an SVG Image

how to Add the file star.svg to the page using the <img> element. The file is located inside the img folder.

it keeps saying bummer

index.html
<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Scalable Vector Graphics</title>
    <link rel="stylesheet" href="css/normalize.css">
    <link rel="stylesheet" href="css/main.css">
  </head>
  <body>

    <h1>SVG Example</h1>

    <div class="wrapper">

      <!-- Add your code below this line -->


    </div>

  </body>
</html>

1 Answer

Olivia Orr
Olivia Orr
7,921 Points

Hey Allison,

Did you remember to add the alt attribute? Your code should look something like this:

<img src="img/star.svg" alt="Gold Star">

If the image is inside the img folder, you have to be sure to include the file path to access the image itself (which is img/[name of your image]). It's best practice to include the alt attribute for folks with screen readers and visual impairments. Hope that helps!

There is no image in the Star Exampl<p>of the html sample of the quiz. And there is no width and height measurements to reference for the star image<img>. So how can someone attribute the .svg without the property needed to place in the HTML document.