HTML Standard: <img> tag

<img> tag

Inserts an image.

Attributes
Attribute Description
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 and SVG. SVG images require ImageMagick extension.
style Inline styles. Styles can also be applied using style tags.
width Sets the image width: px.
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
Code samples

Example #1

The resulting Word document looks like:

Example #2

The resulting Word document looks like: