Anchors and img elements: connecting pages together and embedding visuals responsibly.
The anchor element (a) with an href creates hyperlinks to other pages, in-page fragments (#section-id), email addresses (mailto:) or phone numbers (tel:). The target attribute controls where the link opens, and when you use target="_blank" you should add rel="noopener noreferrer" to prevent the new page from getting access to window.opener. Absolute versus relative URLs, and understanding how paths resolve, is a frequent warm-up question.
Images use the void img element with src and a meaningful alt attribute, which screen readers announce and browsers display if the image fails to load; purely decorative images get an empty alt. Modern pages also use width and height to prevent layout shift, loading="lazy" to defer offscreen images, and srcset with sizes or the picture element to serve responsive images and modern formats like WebP or AVIF. Writing good alt text and avoiding 'click here' as link text are small details that signal real-world experience.
What you'll walk away knowing