📱
HTML Widget
  • HTML Widget
  • Getting Started
    • Regular Use
    • Module Use
  • About
    • The Function
    • Types
  • Components
    • <widget>
    • <stack>
    • <spacer>
    • <img>
    • <text>
    • <date>
    • <style>
    • <!-- Comment -->
  • Add-ons
    • Add-ons
    • <symbol>
    • <hr>
    • <progress>
    • <blockquote>
  • Template
    • Templates
    • Mapping
    • Render
  • Examples
    • Hello, World!
    • Reddit Widget
  • Closing Remarks
    • Bug Fixes and Feedback
    • Support
Powered by GitBook
On this page
  1. Components

<img>

About The Img Tag

<widget>
  <img src="https://raw.githubusercontent.com/Normal-Tangerine8609/Scriptable-HTML-Widget/main/images/logo.jpeg"/>
</widget>

The <img> element defines a widget image element. It is a self-closing tag, meaning you do not need a second closing tag but it must be marked with a forwardslash at the end.

Attributes

src - image

Defines the image. All <img> elements must have a src attribute. This attribute cannot be set with css.

borderColor - colour

Defines the border color.

borderWidth - posInt

Defines the border width.

cornerRadius - posInt

Defines the corner radius.

imageOpacity - decimal

Defines the opacity of the image.

imageSize - size

Defines the size of the image.

tintColor - colour

Defines the tint color.

url - url

Defines the image URL.

contentMode - contentMode

Defines the content mode of the image (filling or fitting).

alignImage - alignImage

Defines the horizontal alignment of the image.

resizable - bool

On true, it does not allow the image to be resizable.

Previous<spacer>Next<text>

Last updated 2 months ago