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.
Responsive URLssrc-mobile, src-tablet, src-desktopUse a different source for each viewport.
Responsive profileresponsive=carteAsk Asset Manager for three adapted formats.

Use src-mobile, src-tablet, and src-desktop when the composition or the source file must change according to the available screen width. src-smartphone is accepted as an alias for src-mobile.

![Responsive product presentation](https://dummyimage.com/1400x700/172554/e2e8f0?text=Desktop){
  src-mobile="https://dummyimage.com/600x900/7c2d12/ffedd5?text=Smartphone"
  src-tablet="https://dummyimage.com/1000x700/134e4a/ccfbf1?text=Tablet"
  src-desktop="https://dummyimage.com/1400x700/172554/e2e8f0?text=Desktop"
}

Responsive product presentation

The renderer creates a <picture> with these breakpoints:

ViewportSelected source
Smartphonesrc-mobile up to 767px.
Tabletsrc-tablet from 768px to 1199px.
Desktopsrc-desktop from 1200px.

The Markdown URL remains the desktop fallback when src-desktop is omitted. If src-tablet is omitted, the desktop URL is reused. If src-mobile is omitted, the tablet URL is reused. This explicit-source mode works with ordinary static files and does not require Asset Manager. Responsive images default to loading="lazy" and decoding="async"; both attributes can be overridden explicitly. A responsive image using lightbox opens the source currently selected by the browser.

When the same source and composition work at every size, responsive=profile adds one Asset Manager preset per viewport:

![Description](/images/hero-fallback.webp){ responsive=carte }

The simplified generated HTML is:

<picture class="frontmark-optimized-picture frontmark-responsive-picture">
  <source
    media="(max-width: 767px)"
    srcset="/images/hero-fallback.webp?preset=small"
  >
  <source
    media="(max-width: 1199px)"
    srcset="/images/hero-fallback.webp?preset=card"
  >
  <img
    src="/images/hero-fallback.webp?preset=medium"
    alt="Description"
    loading="lazy"
    decoding="async"
  >
</picture>

The profiles map each viewport to the following Asset Manager presets. Every profile uses three distinct, increasing preset widths:

ProfileSmartphone presetTablet presetDesktop presetUsage
iconemicro (64px)icon (128px)miniature (256px)Icons and small avatars.
avataricon (128px)miniature (256px)thumbnail (320px)Profiles and authors.
miniatureminiature (256px)thumbnail (320px)small (480px)Lists and previews.
cartesmall (480px)card (640px)medium (800px)Cards, products, and news.
contenucard (640px)large (1024px)article (1200px)Embedded content images.
articlemedium (800px)article (1200px)xl (1600px)Main article image.
bannierelarge (1024px)xl (1600px)hero (1920px)Horizontal banners.
heroarticle (1200px)hero (1920px)2.5k (2560px)Full-width images.
herohdhero (1920px)2.5k (2560px)4k (4096px)High-density displays.

These are requested widths. Asset Manager cannot create missing source detail: use an original at least as wide as the largest preset when the desktop output must reach that resolution.

Accented and separated profile spellings are normalized: icône, bannière, and hero-hd are accepted. For a one-off mapping, provide exactly three Asset Manager identifiers in smartphone, tablet, desktop order:

![Custom responsive image](/images/custom.webp){ responsive="micro,thumbnail,2.5k" }

The profile can also be combined with three different Asset Manager URLs. FrontMark appends the appropriate preset to each URL and preserves any existing query parameters and fragment:

![Responsive art direction](/images/desktop.webp){
  src-mobile="https://assets.example.com/mobile.webp?tenant=docs"
  src-tablet="https://assets.example.com/tablet.webp?tenant=docs"
  src-desktop="https://assets.example.com/desktop.webp?tenant=docs"
  responsive=carte
}
FormatIdentifierWidthQuality
Micromicro64px75
Iconicon128px78
Miniatureminiature256px80
Thumbnailthumbnail320px80
Smallsmall480px81
Cardcard640px82
Mediummedium800px83
Largelarge1024px84
Articlearticle1200px85
XLxl1600px85
Herohero1920px85
2K2k2048px88
2.5K2.5k2560px89
4K4k4096px90
6K6k6144px91
8K8k8192px92
OriginaloriginalSource width90
![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.

- ![Architecture civile](https://assets.ia86.cc/i/e9Q4a_pnYN.webp){: width="32" style="vertical-align:middle; margin-right: .45rem; border: 2px solid #0f766e; border-radius: 6px;"} Architecture civile / ponts, maisons...
- ![Mini landscape](https://dummyimage.com/120x80/fef3c7/92400e&text=Photo){ width="48" style="vertical-align:middle; margin-right: .45rem; border: 3px solid #f97316; border-radius: 999px;" } Texte **gras** avec [un lien](/docs/images-material/).
  • Architecture civile Architecture civile / ponts, maisons...
  • Mini landscape Texte gras avec un lien.
![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.