Skip to content

Image

Overview

Image displays a responsive image in your email. It is similar to the HTML <img /> tag. Note that if no width is provided, the image will use the parent column width.


Parameters

ParameterParameterValid BlocksRequired
Style Sets Optional list of Email Style blocks to apply to this block Text Block Group No
Custom CSS Classes Optional space-separated list of CSS classes to be applied to the element. Intended for use with EmailCSS blocks. Text Block Group No
Image URL The absolute URL of the image Text Block Group No
Srcset Use a different image source based on display conditions.

One or more strings separated by commas, indicating possible image sources for the email client to use. Each string is composed of:

  1. A URL to an image
  2. Optionally, whitespace followed by one of:
    • A width descriptor (a positive integer directly followed by w). The width descriptor is divided by the source size given in the sizes attribute to calculate the effective pixel density.
    • A pixel density descriptor (a positive floating point number directly followed by x).

If no descriptor is specified, the source is assigned the default descriptor of 1x.

It is incorrect to mix width descriptors and pixel density descriptors in the same srcset attribute. Duplicate descriptors (for instance, two sources in the same srcset which are both described with 2x) are also invalid.

If the srcset attribute uses width descriptors, the sizes attribute must also be present, or the srcset itself will be ignored.

The email client selects any of the available sources at its discretion. This provides them with significant leeway to tailor their selection based on things like user preferences or bandwidth conditions.

Srcset Image Block Group No
On-Click URI The link to take the user to when they click on this element. Text Block Group No
Rel The rel of the element. Text Block Group No
Target The target for the link. Defaults to 'external-link'. Text Block Group No
Use Image Map Use an image map. Please note: Support for this feature is not wide-spread. Text Block Group No
Image Link Name Specify the image link name attribute. Text Block Group No
Image description Used by screen readers and e-mail clients with image downloads switched off. Text Block Group No
Mouse-Over Tooltip The text to display when the mouse pointer is over the image Text Block Group No
Height The height of the image. Unit Value Block Group No
Width The width of the element. Unit Value Block Group No
Fluid on Mobile If true, the image will always be full-width on mobile, even if an image width is set. Boolean Block Group No
Sizes: Media queries One or more strings separated by commas, indicating a set of source sizes. Each source size consists of:
  1. A media condition. This must be omitted for the last item in the list.

  2. A source size value.

Media Conditions describe properties of the viewport, not of the image. For example, (max-height: 500px) 1000px proposes to use a source of 1000px width, if the viewport is not higher than 500px.

Source size values specify the intended display size of the image. Email clients use the current source size to select one of the sources supplied by the srcset attribute, when those sources are described using width (w) descriptors.

The selected source size affects the intrinsic size of the image (the image&quot;s display size if no CSS styling is applied). If the srcset attribute is absent, or contains no values with a width descriptor, then the sizes attribute has no effect.

Text Block Group No
Padding The padding around the element. Text Block Group No
Padding Bottom The padding below the element. Unit Value Block Group No
Padding Left The padding to the left of the element. Unit Value Block Group No
Padding Right The padding to the right of the element. Unit Value Block Group No
Padding Top The padding above the element. Unit Value Block Group No
Border The border around the element. Text Block Group No
Border Top The border across the top of the element. Text Block Group No
Border Right The border down the right of the element. Text Block Group No
Border Bottom The border across the bottom of the element. Text Block Group No
Border Left The border down the left of the element. Text Block Group No
Border Radius The rounding radius of the corners of the element. Text Block Group No
Horizontal Alignment How the block should be aligned horizontally within its container. Text Block Group No
Container Background Colour The colour of the background of the container. Colour Block Group No

Attributions

MDN Web Docs - Image Element Attributes