HTML Standard: <img> tag

<img> tag

Inserts an image.

Attributes
Attribute Description
alt Sets the description value.
class One or more classes.
id Id.
height Sets the image height: px.
src Path source of the image (as image file, base64 or as stream): JPG, PNG, GIF, BMP, WEBP and SVG. SVG images require ImageMagick extension.
style Inline styles. Styles can also be applied using style tags.
width Sets the image width: px.

To download images from remote URLs, please check that allow_url_fopen is enabled in the PHP config. If the remote images use HTTPS, please check that PHP is using a valid certification file and the SSL configuration is correct: More information.

Styles
Style Description
border border-color:
  • hexadecimal colors (not all HEX colors are supported by MS Word for this style)
border-style:
  • dashed
  • dotted
  • none
  • solid
border-width:
  • length: px
display
  • none
float
  • left
  • right
height
  • auto
  • length: cm, em, in, pt, px
margin, margin-top, margin-right, margin-bottom, margin-left Property values:
  • length: em, pt, px
  • percentage

Applied when setting a border

padding, padding-top, padding-right, padding-bottom, padding-left Property values:
  • length: em, pt, px
  • percentage

Applied when setting a border

vertical-align
  • middle
  • text-top
  • top
width
  • auto
  • length: cm, em, in, pt, px
CSS Extended (Premium licenses)
Style Description
max-width cm, em, in, pt, px.
max-height cm, em, in, pt, px.
Code samples

Example #1

The resulting Word document looks like:

Example #2

The resulting Word document looks like: