Skip to main 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 SetsOptional list of Email Style blocks to apply to this blockText Block GroupNo
Custom CSS ClassesOptional space-separated list of CSS classes to be applied to the element. Intended for use with EmailCSS blocks.Text Block GroupNo
Image URLThe absolute URL of the imageText Block GroupNo
SrcsetUse 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 GroupNo
On-Click URIThe link to take the user to when they click on this element.Text Block GroupNo
RelThe rel of the element.Text Block GroupNo
TargetThe target for the link. Defaults to 'external-link'.Text Block GroupNo
Use Image MapUse an image map. Please note: Support for this feature is not wide-spread.Text Block GroupNo
Image Link NameSpecify the image link name attribute.Text Block GroupNo
Image descriptionUsed by screen readers and e-mail clients with image downloads switched off.Text Block GroupNo
Mouse-Over TooltipThe text to display when the mouse pointer is over the imageText Block GroupNo
HeightThe height of the image.Unit Value Block GroupNo
WidthThe width of the element.Unit Value Block GroupNo
Fluid on MobileIf true, the image will always be full-width on mobile, even if an image width is set.Boolean Block GroupNo
Sizes: Media queriesOne 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 GroupNo
PaddingThe padding around the element.Text Block GroupNo
Padding BottomThe padding below the element.Unit Value Block GroupNo
Padding LeftThe padding to the left of the element.Unit Value Block GroupNo
Padding RightThe padding to the right of the element.Unit Value Block GroupNo
Padding TopThe padding above the element.Unit Value Block GroupNo
BorderThe border around the element.Text Block GroupNo
Border TopThe border across the top of the element.Text Block GroupNo
Border RightThe border down the right of the element.Text Block GroupNo
Border BottomThe border across the bottom of the element.Text Block GroupNo
Border LeftThe border down the left of the element.Text Block GroupNo
Border RadiusThe rounding radius of the corners of the element.Text Block GroupNo
Horizontal AlignmentHow the block should be aligned horizontally within its container.Text Block GroupNo
Container Background ColourThe colour of the background of the container.Colour Block GroupNo

Attributions

MDN Web Docs - Image Element Attributes