HTML

HTML Images and Media

Images, alt text, video and audio, and getting responsive images right without a framework.

15 articles Last updated 12 Jul 2026

Images and Media Articles

The img Element and How src Works

The image element is a void element with two required attributes, and the second one is the one most people leave out. Its behaviour on failure is worth understanding.

By Coding Tutorials Team 12 Jul 2026

How to Write Alt Text That Actually Helps

The hardest part of alt text is knowing when to write nothing at all. An empty alt attribute is often the correct answer, and it is not the same as omitting it.

By Coding Tutorials Team 12 Jul 2026

Responsive Images with srcset and sizes

Serving one large image to every device wastes bandwidth on phones and looks soft on high density screens. Two attributes let the browser choose properly.

By Coding Tutorials Team 10 Jul 2026

The picture Element and Art Direction

The picture element is not a better srcset. It answers a different question, and using it for the wrong one produces markup that is harder to maintain for no gain.

By Coding Tutorials Team 10 Jul 2026

Using figure and figcaption for Captions

A caption and alt text do different jobs and should say different things. The figure element is what ties a caption to the thing it describes.

By Coding Tutorials Team 10 Jul 2026

Lazy Loading Images and Why It Matters

One attribute defers images until they are needed, and applying it to every image on the page is a reliable way to make the page feel slower.

By Coding Tutorials Team 8 Jul 2026

Image Dimensions and Preventing Layout Shift

For years the advice was to leave dimensions out of the markup. That advice reversed, and the reason is a metric that affects both users and rankings.

By Coding Tutorials Team 8 Jul 2026

SVG in HTML: Inline, img or Background

SVG can be embedded three ways and the choice is not cosmetic. Only one of them lets CSS reach inside the graphic.

By Coding Tutorials Team 8 Jul 2026

Background Images and Content Images

The rule is simple and often ignored. If the image carries information it goes in the markup, and if it is decoration it goes in the stylesheet.

By Coding Tutorials Team 6 Jul 2026

The HTML video Element Explained

Video plays natively in every browser with no plugin. The attributes are simple, and one of them will silently refuse to work unless paired with another.

By Coding Tutorials Team 6 Jul 2026

The HTML audio Element and Podcast Players

The audio element is the simpler sibling of video and follows the same rules. The most valuable thing you can add to it is not a player feature at all.

By Coding Tutorials Team 6 Jul 2026