Inkcite 1.18.3

Background Image

Hassle-free, bulletproof, responsive background images - even in Outlook.

The {background} Helper provides consistent, reliable background images in modern email clients including all versions of Outlook (through VML). Inkcite’s implementation, which is based on Campaign Monitor’s Bulletproof Background Images, makes it easy to customize its appearance (such as font family, size, weight and alignment) plus support for mobile-only overrides.


Example Inkcite markup:

 {background src=YJOX1PC.png bgcolor=#7bceeb height=92 width=120}

An example of the resulting email HTML output:

<table bgcolor=#7bceeb border=0 cellpadding=0 cellspacing=0 style="background:#7bceeb url(images/YJOX1PC.png);width:120px" width=120>
    <td><!--[if mso]><v:rect fill="t" stroke="f" style="height:92px;width:120px" xmlns:v="urn:schemas-microsoft-com:vml"><v:fill color="#7bceeb" src="images/YJOX1PC.png" type="tile" /><v:textbox inset="0,0,0,0"><![endif]-->
        <table border=0 cellpadding=0 cellspacing=0 width=100%>
            <td height=92 style="height:92px">
      <!--[if mso]></v:textbox></v:rect><![endif]--></td>

Inkcite’s markup is 84% shorter than conventional HTML.


Attributes in bold are required.

Specifies the alignment of the text within this element. Set alignment to justify to enable justified text within this element.
Optional hex color that, when present, enables a background gradient from the element’s background color to this color.
When background-gradient is present, allows you to control the position of the gradient.
Controls the shape of the background gradient - either liner or radial.
Controls how the background aligns in the element for clients that support CSS backgrounds. Since Outlook doesn’t support background placement, it is recommended that you use outlook-src and specify a background image that covers the entire area just for those clients.
The background color to display by default if images are disabled or background images aren’t supported.
Optional border to display around this background. Supports directional borders (e.g. border-left).
When a border is defined, controls the border radius in pixels.
Specifies the color of the text on or inside this element. Colors specified in CSS shorthard (e.g. #345) will automatically expand to the full declaration (e.g. #334455) to maximize compatibility.
When present creates a duotone image. Specify the gradient of dark to light in the format of #light-#dark, e.g. #C2D6D9-#44607f
Specifies the named font style corresponding to one or more values set in the helpers.tsv file describing the font.
Specifies one or more font familes for this element in the order they will be used per CSS standards.
Specifies the size of the font in pixels for text on or inside of this element.
Specifies the font weight for this element’s text either as a weight (e.g. 400) or simply as bold. Overrides the font weight attribute of the named font style if it is applied to this element.
The height of the background image. When omitted the background area will expand based on the contents within.
Specifies the spacing in pixels between the letters on this element. Overrides the letter spacing if a named font style is applied to this element.
Specifies the line height in pixels by default, or if units are provided (e.g. 1.5em) they will be converted to pixels to maximize compatibility. Overrides the line height of the named font style if it is applied to this element.
Declares the behavior of this background element on mobile devices will typically be fill.
Specifies an alternate background image to display on mobile devices.
Controls how the background fits within the element on mobile devices - e.g. bottom.
Specifies the background repeat behavior on mobile devices. By default, if a background-position is specified, the image does not repeat. Override this behavior with this attribute.
Specifies the size attribute of this background image on mobile devices - e.g. fill or cover
Overrides the normal background color on mobile devices.
Specifies the padding on this element (in pixels) when it displays on mobile devices.
Optional override for the width of this element on mobile devices.
Specify an alternate background image for Outlook email clients that support VML (e.g. Outlook 2007-2016). Those Outlook clients will display this image instead of the one specified in the src attribute.
Specifies the padding (in pixels) between the edges of the background image and the content within.
Enables text shadowing in the specified hex color. By default the shadow is offset directly below the text by one pixel.
When shadow is enabled, overrides the CSS blur default value in pixels.
When shadow is enabled, overrides the vertical CSS shadow offset, set in pixels.
The name of the image (in your project’s images/ directory) to display in the background.
Specify the vertical alignment of the content within the background image - e.g. middle. Useful only if you’ve specified a height that is larger than the content contained within the background.
The width of the background image. When omitted or if fill or 100% are provided, will fill the available horizontal space.

Project Config

Set the default values for all {Background Image} Helpers by setting these attributes in helpers.tsv:


Disable Outlook compatibility on this and other Helpers by setting vml to false your projects config.yml file.


When set to true enables verbose MSO-specific styles enabling text shadows in certain versions of Microsoft Outlook (e.g. 2007-2016) whenever shadow is applied to an element.


Bulletproof background image support courtesy of @stigm via Campaign Monitor