Represents an image. The image given by the src attribute, and the value of the alt attribute is the img element's fallback text content in case the source is not found.

Technical details about this element can be found on the Official W3C reference

no subtypes hierarchy

Initializer
Img(String src, String alt = "", String? useMap = null, Boolean? isMap = null, Integer? width = null, Integer? height = null, String? id = null, CssClass classNames = [], String? style = null, String? accessKey = null, String? contextMenu = null, TextDirection? dir = null, Boolean? draggable = null, DropZone? dropZone = null, Boolean? inert = null, Boolean? hidden = null, String? lang = null, Boolean? spellcheck = null, Integer? tabIndex = null, String? title = null, Boolean? translate = null, Aria? aria = null, NonstandardAttributes nonstandardAttributes = ..., DataContainer data = ...)
Parameters:
  • src

    A valid Uri to the image resource.

  • alt = ""

    Provides equivalent content for those who cannot process images or who have image loading disabled

  • useMap = null

    If present, can indicate that the image has an associated image map. It must reference a valid Map element's id.

  • isMap = null
  • width = null
  • height = null
  • id = null
  • classNames = []
  • style = null
  • accessKey = null
  • contextMenu = null
  • dir = null
  • draggable = null
  • dropZone = null
  • inert = null
  • hidden = null
  • lang = null
  • spellcheck = null
  • tabIndex = null
  • title = null
  • translate = null
  • aria = null
  • nonstandardAttributes = empty
  • data = empty
Attributes
altSource Codeshared String alt

Provides equivalent content for those who cannot process images or who have image loading disabled

attributesSource Codeshared actual <String->Object>[] attributes
Refines BaseElement.attributes ultimately refines Node.attributes
heightSource Codeshared Integer? height
isMapSource Codeshared Boolean? isMap
srcSource Codeshared String src

A valid Uri to the image resource.

tagSource Codeshared actual Tag tag

The tag name and type.

Refines Node.tag
useMapSource Codeshared String? useMap

If present, can indicate that the image has an associated image map. It must reference a valid Map element's id.

widthSource Codeshared Integer? width
Inherited Attributes
Attributes inherited from: BaseElement
Attributes inherited from: Element
Attributes inherited from: Object
Attributes inherited from: StyledElement
Attributes inherited from: Node
Inherited Methods
Methods inherited from: Object