04.05 · Lists, links and images / Watch · 5 min
Use an actual image URL Distinguish an image file URL from the page where you discovered the image.
Activity 5 of 7 in Lists, links and images
Rob’s comic strip · Lists, links and images ORIGINAL WALKTHROUGH · 4:40
Watch with Rob. Pause whenever you want to try a change. You can return to the lesson at any time.
THE CODE ZONE / WATCH WITH ROB Use an actual image URL Watch with a membership or start a free trial 4:40 × LEARN WITH THE CODE ZONE
Unlock this video walkthrough Written lessons and coding practice are free. Video walkthroughs are included with a paid Code Zone membership or an active free trial.
Have a Code Zone website account? Use your learning account’s email to get a six-digit sign-in code, or use your existing website password.
Need a website account? Paid Skool members and active trial members can use the email from their membership questions to request a sign-in code. No invite link or Skool password needed.
Close this window to keep practicing. After signing in, you’ll return to this lesson.
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.
Starter source code for VS Code Copy the source below or download the file to follow along in VS Code.
The download includes a lesson link in each file and a README so you can find your way back.
index.html Copy code
index.html html · example
<!--
Follow Rob’s original use an actual image url walkthrough. Pause, make one change and inspect the page. Use the attached lesson’s task and resource links. This separate workspace is for your own code-along experiments.
-->
<! DOCTYPE html >
< html lang = "en" >
< head >
< meta charset = "UTF-8" />
< meta name = "viewport" content = "width=device-width, initial-scale=1" />
< title >Image Tags</ title >
</ head >
< body >
< h1 >Cat image</ h1 >
< img
src = "https://images.unsplash.com/photo-1592194996308-7b43878e84a6?auto=format&fit=crop&w=600&q=80"
alt = "A cat indoors"
width = "400"
/>
</ body >
</ html >
Watch here. Code in another tab. The lesson task is already in your workspace. Move that tab to a second screen if you like. Run your code, save a private account draft when signed in, and share a help link in The Code Zone community.
This workspace has its own saved code. It won’t replace your work in the shorter practice activity.
Choose the file, then describe it Rob’s original example uses a cat image hosted at images.unsplash.com. A photo’s webpage URL and the actual image URL are different resources: img needs the image resource.
If you download a photo into your own project, use its local relative path instead. Check the image provider’s current terms for the photo you select.
Choose the file, then describe it Copy code
index.html html · example
<! DOCTYPE html >
< html lang = "en" >
< head >
< meta charset = "UTF-8" />
< meta name = "viewport" content = "width=device-width, initial-scale=1" />
< title >Image Tags</ title >
</ head >
< body >
< h1 >Cat image</ h1 >
< img
src = "https://images.unsplash.com/photo-1592194996308-7b43878e84a6?auto=format&fit=crop&w=600&q=80"
alt = "A cat indoors"
width = "400"
/>
</ body >
</ html > Load this code into the editor Avoid stretching a large source Use a suitable image size and keep its proportions. The course preview supplies basic max-width support; that supporting preview style is not a CSS assignment.
Try a meaningful alt description and inspect the loaded picture, rather than choosing an alt value based only on the filename.
YOUR TURN
Use an actual image URL — explore Load an example into this editor, make one change and Run code to inspect the page. This exploration has no pass/fail grade. Save a private account draft or share an independent help snapshot when signed in.
Load an example, edit it and run it. Word wrap is enabled.
THE CODE ZONE / YOUR CODING WORKSPACE Open live editor Click to reveal your workspace. No installation needed. Run code Check challenge Reset starterAsk a question & share code Save to GitHub Save to GitHub Save your current code with optional notes in this lesson’s GitHub folder.
Keep your code. Keep your progress. Save your coursework to your own GitHub repository as part of your Code Zone membership.
An active coding community to learn alongside A place to ask questions and get help when you’re stuck GitHub saves to keep a versioned backup of your work
Checking your GitHub connection…
Connect GitHub Change repository Disconnect GitHub
Choose Only select repositories on GitHub and select your learning repository. Your other repositories do not need to be connected.
Learning repositoryChoose a repository Refresh repositories Use this repository
Choose an existing repository, or create a learning repository on GitHub (opens in a new tab) . Include a README when creating it so it has a default branch, then connect it here.
Saved to GitHub Your code and notes are saved.
Close modal
Save your code to your profile. Choose Save account draft to keep this workspace in your profile and continue on another device. Your account draft opens automatically when this device has no local draft; Load account draft lets you choose it yourself. Submit sends a fixed copy of your code and current browser checks to your instructor. You can submit even if a check fails. After your first submission, an instructor or tutor must reopen this exercise before you can submit changed code again. Saving drafts and experimenting stay available.
Save account draft Load account draft
Look for an existing answer in the community, then share your question and code if you are stuck.
Your community question or submission note (optional) Want direct instructor help? Describe what you tried and where you got stuck in your submission note. You can hide this prompt in My account → Learning preferences.
Submit for review Refresh submission status & feedback
Ask the community and share your code Create a fixed copy of your current code, question above, and current browser check results. Anyone with the link can view it without signing in. Your email, private drafts, and instructor feedback are not included. You can choose whether to show your name below.
Check your code and question for passwords or personal information before sharing. You can revoke the link here later.
Asking for help
Include this name and initials avatar on my shared page I want anyone with the link to see this code and question.Create and copy help link Your active help links for this exercise Refresh shared links
Your submissions and instructor feedback
Replace your editor code? Your current work will be replaced. Choose Cancel to keep it.
Cancel Replace code 04.04 HTML images and alternative textNext: 04.06 Follow a relative image path