Intern Track Roadmap

Links and images

This course covers how links and images work in HTML and Rails. It explains why href makes the a tag a link, when to use relative or absolute URLs, and how link_to with named routes keeps paths current. It covers link text that makes sense out of context, target="_blank" and reverse tabnabbing, and the main img attributes. It also covers alt text, responsive images with srcset and picture, and a product card that combines these rules.

What you'll learn

  • ✓How href, relative and absolute URLs, anchors, mailto and tel links work
  • ✓Writing link text that makes sense in a screen reader's links list
  • ✓What target="_blank" and rel="noopener noreferrer" do
  • ✓Using src, width, height and loading on img to avoid layout shift
  • ✓Writing alt text, or leaving it empty for decorative images
  • ✓Serving responsive images with srcset, sizes and picture
Free preview · Lesson 1 3 min read

The a tag: more than blue underlined text

href isn't one option among several for <a>: it's what makes the tag a hyperlink at all. An <a> with no href isn't keyboard-focusable and gets no link role in the accessibility tree that the last three courses checked in DevTools. It's inline text styled like a link:

Read the full lesson free →

Curriculum

7 lessons
Type to start searching...