Image lightbox showcase

This post exercises the built-in image lightbox in every situation, using plain grey placeholder images. Click any image in the post body to open it full screen, then click anywhere or press Esc to close. Images that are wrapped in a link are intentionally left alone so the link still works.

1. Standard Markdown image

A plain Markdown image. It should be zoomable, and its alt text becomes the dialog label.

A plain grey placeholder

2. Image in a figure with a caption

Wrapped in <figure> with a <figcaption>. The image is zoomable; the caption stays put.

A wide grey placeholder
Fig 1. An image with a caption below it.

This image is wrapped in a link. Clicking it should follow the link, not open the lightbox.

Click me — I open the repository

4. Image without alt text

No alt attribute. Still zoomable; the dialog falls back to a generic label.

5. Small image

Images smaller than the viewport are centered and shown at their natural size.

A small grey placeholder

6. Several images in a row

Wrapped in <div class="gallery"> for a neat, equal-height responsive row that wraps on small screens. Each one still opens independently in the lightbox.

7. Inline image inside a paragraph

An image can also sit inline in a sentence like this one tiny placeholder and it stays zoomable without breaking the text flow.

8. Raw HTML <img> tag

Authored directly as HTML rather than Markdown — behaves the same.

A grey placeholder rendered from raw HTML

9. Images inside a list

Images in list items are shrunk to small, aligned thumbnails so the list stays tidy. Each thumbnail is still zoomable.

  • Thumbnail A list item that starts with a small thumbnail.
  • Thumbnail Another item, with a wider thumbnail.
  • A plain list item for comparison.

10. A linked image inside a figure

Combines cases 2 and 3: the figure is decorative, but the image links out, so the link wins over the lightbox.

Figure image that is also a link
Fig 2. A captioned image that links to the repository.

That covers every case the lightbox needs to handle: plain, captioned, linked, alt-less, small, repeated, inline, raw HTML, and list-embedded images.

updated_at 25-10-2026