Skip to content

Images Material

FormSyntaxUsage
Image![Alt](/image.png)Standard image.
Alignmentalign=left / align=rightFloat.
Sizewidth, heightDimensions.
Large.full-width / .full-width-centeredLarge figure.
Mini.mini-width align=rightCompact figure.
Caption/// captionCaption.
Loadingloading=lazyLazy loading.
LightboxlightboxOpen the image in a small modal window.
Themedata-light, data-darkSources light/dark.
![Image with lightbox](https://dummyimage.com/1000x620/0f172a/e2e8f0&text=Click+to+open){ width="420" lightbox lightbox-caption="Lightbox preview" loading=lazy }

Image with lightbox

![Image aligned left](https://dummyimage.com/600x400/edf2f7/6b7280&text=Align+left){ align=left width="260" }

In a technical guide, a left-aligned image can support a short explanation without breaking the reading flow. Text flows to the right when horizontal space is sufficient.

On mobile, the image returns to full width to preserve comfortable reading and avoid overly narrow columns.

Image aligned left

In a technical guide, a left-aligned image can support a short explanation without breaking the reading flow. Text flows to the right when horizontal space is sufficient.

On mobile, the image returns to full width to preserve comfortable reading and avoid overly narrow columns.

![Image aligned before heading](https://dummyimage.com/600x400/1e293b/cbd5e1&text=Float+stop){ align=left width="260" }

This paragraph flows beside the image. The following heading clears the wrap and starts below the image if it is still taller than the nearby text.

### New heading that clears alignment

This text is no longer placed beside the previous image. The `clear` applied to headings stops the float from this point.

Image aligned before heading

This paragraph flows beside the image. The following heading clears the wrap and starts below the image if it is still taller than the nearby text.

New heading that clears alignment

This text is no longer placed beside the previous image. The clear applied to headings stops the float from this point.

![Image aligned right](https://dummyimage.com/600x400/111827/d1d5db&text=Align+right){ align=right width="260" }

A right-aligned image is useful for a secondary screenshot, reminder diagram, or illustration that should not interrupt the main paragraph.

The syntax preserves the HTML `align` attribute, which keeps the Markdown portable to MkDocs Material.

Image aligned right

A right-aligned image is useful for a secondary screenshot, reminder diagram, or illustration that should not interrupt the main paragraph.

The syntax preserves the HTML align attribute, which keeps the Markdown portable to MkDocs Material.

<figure markdown="span">
  ![Image with caption](https://dummyimage.com/600x400/1f2937/e5e7eb&text=Figure){ width="320" loading=lazy }
  <figcaption>Caption produced from an HTML `figure` block compatible with MkDocs Material.</figcaption>
</figure>
Image with caption
Caption produced from an HTML `figure` block compatible with MkDocs Material.
![Image with caption](https://dummyimage.com/600x400/334155/e2e8f0&text=Caption){ width="320" }
/// caption
Caption produced by the `pymdownx.blocks.caption` syntax, useful when you want to keep a classic Markdown image.
///
Image with caption
Caption produced by the pymdownx.blocks.caption syntax, useful when you want to keep a classic Markdown image.
![Full-width image left](https://dummyimage.com/900x260/0f172a/e5e7eb&text=Full+width+left){ .full-width align=left loading=lazy }

Full-width image left

![Full-width image right](https://dummyimage.com/900x260/172554/e5e7eb&text=Full+width+right){ .full-width align=right loading=lazy }

Full-width image right

![Full-width image centered](https://dummyimage.com/900x260/1e293b/e5e7eb&text=Full+width+center){ .full-width align=center loading=lazy }

Full-width image centered

![Centered image with border](https://dummyimage.com/900x260/1f2937/e5e7eb&text=Full+width+centered+border){ .full-width-centered loading=lazy }

Centered image with border

![Mini image left](https://dummyimage.com/480x260/334155/e2e8f0&text=Mini+left){ .mini-width align=left width="260" loading=lazy }

Text stays beside the image in mini left-aligned mode when page width allows it.

Mini image left

Text stays beside the image in mini left-aligned mode when page width allows it.

![Mini image centered](https://dummyimage.com/480x260/475569/e2e8f0&text=Mini+center){ .mini-width align=center width="260" loading=lazy }

Mini centered mode keeps the block centered in the main column without overflowing toward the table of contents.

Mini image centered

Mini centered mode keeps the block centered in the main column without overflowing toward the table of contents.

![Mini image right](https://dummyimage.com/480x260/64748b/f8fafc&text=Mini+right){ .mini-width align=right width="260" loading=lazy }

Text stays beside the image in mini right-aligned mode when page width allows it.

Mini image right

Text stays beside the image in mini right-aligned mode when page width allows it.

![Image lazy](https://dummyimage.com/900x500/0f766e/ecfeff&text=loading+lazy){ loading=lazy width="420" }

The `loading=lazy` attribute is passed directly to the image.

Image lazy

The loading=lazy attribute is passed directly to the image.

![Image visible in light mode](https://dummyimage.com/600x240/f5f5f5/777777&text=Only+light#only-light)
![Image visible in dark mode](https://dummyimage.com/600x240/21222c/d5d7e2&text=Only+dark#only-dark)

The `#only-light`, `#only-dark`, `#gh-light-mode-only` and `#gh-dark-mode-only` fragments are hidden according to the active theme.

Image visible in light mode Image visible in dark mode

The #only-light, #only-dark, #gh-light-mode-only and #gh-dark-mode-only fragments are hidden according to the active theme.

![Styled image](https://dummyimage.com/600x300/312e81/e0e7ff&text=Style+inline){ width="360" style="border-radius: 8px; border: 2px solid #818cf8;" loading=lazy .image-demo #image-demo-stylee }

The `width`, `height`, `style`, `class`, `id`, `title`, `align`, `loading`, `lightbox`, `lightbox-caption`, `lightbox-src` and `lightbox-group` attributes are preserved.

Styled image

The width, height, style, class, id, title, align, loading, lightbox, lightbox-caption, lightbox-src and lightbox-group attributes are preserved.