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

Jack Cummins
Jack Cummins
17,417 Points

Why doesn't this work?

Look at the code to get more info.

If you are the first one to answer and give me the correct code I give out a best answer. If you meet the requirments, but aren't the first one to answer then I will just give you an upvote. Pleeaaase give me the code or else I won't give a best answer or an upvote.

Thanks, Jack

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 -->
      <img src="star.svg">

    </div>

  </body>
</html>

3 Answers

Matthew Long
Matthew Long
28,383 Points

In my experience just asking for the code and not taking the time to understand why something works won't get you very far.

You should take the time to learn it :(

<!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 -->
      <img src="img/star.svg" alt="star">

    </div>

  </body>
</html>
Austin Whipple
Austin Whipple
29,700 Points

This is an important point. Copying and pasting answers from the forums can help pass challenges, but isn't the most effective way to learn. It's critical to understand what is missing and why code is not passing.

For instance, Jack, you're missing the img folder portion of your src attribute. This is why Matthew's code will pass. A helpful hint is given when the code fails without the folder included in the file path: "Bummer! Make sure the src attribute has the correct file path."

Jack Cummins
Jack Cummins
17,417 Points

I studied the code. Now it makes sense to me. Thank you so much Mathew.

Thomas Cheesman
Thomas Cheesman
6,433 Points

I had trouble with this one too. I thought I'd forgotten how to code one of the most basic parts ofHTML! The question only ticked over to correct once I added in the alt text description into the image tag. The question does not explicitly ask you to do this, but some would consider it good practice. I would prefer the question asked students to add alt text.