CHOOSE ANY STEP
FREECODECAMP / HTML / STEP 8 OF 42
freeCodeCamp: Build a Cat Photo App, Step 8
Tell the browser which image to load
Written guidance is free. Step videos are a member benefit.
Inside the image tag, add the source attribute listed in the task below: its name, an equals sign, and a pair of quotation marks. Put the exact relaxing cat image address from freeCodeCamp between those quotes. Keep everything inside the opening image tag.
ORIGINAL WALKTHROUGH ·
Watch with Rob.
Watch the explanation, then apply the change and run the official checks on freeCodeCamp.
You are signed in, but video access needs attention. Check your account access. Your saved work is kept.
Video walkthroughs are included with an active Code Zone membership. The written lesson and practice are free.
Your goals for this step
- Apply the requirements for “Tell the browser which image to load” while keeping the earlier page structure.
- Explain img and the role it plays in this change.
- Explain src and the role it plays in this change.
- Compare the expected preview with your work before running the official checks.
THE TASK
What step 8 asks you to do
- Your code should have an
imgelement. You may have removed theimgelement or you have not surrounded thesrcattribute's value with quotes. - Your
imgelement should have asrcattribute. - Your
imgelement'ssrcattribute should be set tohttps://cdn.freecodecamp.org/curriculum/cat-photo-app/relaxing-cat.jpg. - Although you have set the
imgelement'ssrcto the correct URL, it is recommended to always surround the value of an attribute with quotation marks. - Your
imgelement should be closed either with>or/>.
Based on the official freeCodeCamp step 8 instructions (opens in a new tab).
Why this works
Your image element is in place, but the browser still needs to know which picture to load. In step eight, the source attribute supplies that address. We'll add it inside the existing image tag.
What you should see in the preview
Now the browser can load the cat photo. Check your address against the one in the official step. Every character matters, including capitalization and the file ending. Keep the quotation marks and the tag's closing angle bracket.
Illustrative browser result. External embeds, navigation and form submission are disabled here. Open freeCodeCamp to test the real behavior. Drag the lower-right corner to make this preview taller.
Terms to know
- img: Image element
- Displays an image from its src. It is a void element, so it does not have a closing tag.
- src: Source attribute
- Points an image, audio player, video player or embedded frame to its resource. Use the exact URL required by the task.
If your check does not pass
- Your code should have an
imgelement. You may have removed theimgelement or you have not surrounded thesrcattribute's value with quotes. - Your
imgelement should have asrcattribute. - Your
imgelement'ssrcattribute should be set tohttps://cdn.freecodecamp.org/curriculum/cat-photo-app/relaxing-cat.jpg. - Although you have set the
imgelement'ssrcto the correct URL, it is recommended to always surround the value of an attribute with quotation marks.
Use the preview to inspect the structure, then run the checks on freeCodeCamp. Watching here does not submit code or mark an official step complete.
Know where to find it
You do not have to memorize every element or CSS property. Keep useful references nearby:
- W3Schools: images (opens in a new tab)
Compare the syntax and a focused example.
- W3Schools: attributes (opens in a new tab)
Compare the syntax and a focused example.
- MDN: HTML element reference (opens in a new tab)
Look up the definition, syntax and supported behavior.
What you have accomplished
The change for “Tell the browser which image to load” is ready to try. Return to freeCodeCamp, compare your result with the requirements, and run its checks. Your official progress stays there.
Independent guidance from The Code Zone, not affiliated with or endorsed by freeCodeCamp. Complete official work and certification requirements on freeCodeCamp. Curriculum checked November 15, 2026. Curriculum source (opens in a new tab).