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

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,407 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,725 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.