Property img

The img property is a very advanced property inside image blocks that gives you direct access to the HTML <img> tag. If you want to set custom CSS properties or if you want to add attributes to the <img> tag that are not supported by the responsive API, you can use the nested img property for it.

Inside the img property you can use the css and attributes sub properties to change the <img> tag. Please keep in mind that the img property is a very advanced property, and that you normally do not have to make any changes to the <img> tag that is generated by the responsive API. In a normal input JSON document, you will therefore not see the img property.

Supported sub properties

Property Value Description
css object Add custom css to the a tag
attributes object Add custom HTML attributes to the a tag

Example use

    {
        "from" : "info@example.com",
        "subject" : "Email with a single image",
        "content" : {
            "blocks" : [ {
                "type" : "image",
                "src" : "https://responsiveemail.com/example.png",
                "img" : {
                    "attributes" : {
                        "border" : "1",
                        "longdesc" : "a long story"
                    },
                    "css" : {
                        "border-color" : "red"
                    }
                }
            } ]
        }
    }

Found a typo?

You can find this documentation page on GitHub.
Propose a change