Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Start a free Courses trial
to watch this video
Learn to add images to your project, including the use of self-closing tags. Discover the attributes essential for images, like "src" for source and "alt" for alternative text, and see them in action with practical examples.
Quick Tip
In addition to serving as a fallback for when an image doesn't load, the alt
attribute in the <img>
tag is essential for screen reader users. It provides alternative text that is read aloud by screen readers, enabling users with visual impairments to understand the content and context of the image.
For a more inclusive web experience, ensure your alt
text is descriptive and conveys the meaning of the image.
Resources
Next Step
When referencing files or folders and the path requires stepping outside the current folder, you can use ../
to navigate one level up. This is especially useful when organizing your project files. For example:
<!-- Linking to an image one level up -->
<img src="../images/another-image.jpg" alt="Another Image">
The ../
notation allows you to traverse up a level in the file structure. Incorporate this into your projects to maintain clean and organized file paths.
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up