Notes
The HTML <img>
tag is used to embed an image in a web page.
- src: Specifies the path to the image
- alt: Specifies an alternate text for the image
<img src="/logo.png" alt="Path to Salesforce Logo">
img
and alt
are two attributes of the img element.
If a browser cannot find an image, it will display the value of the alt
attribute:
You can use the width and height attributes to specify the width and height of an image:
<img src="/logo.png" alt="Path to Salesforce Logo" width="120" height="120" >
Note: The width and height attributes always define the width and height of the image in pixels.
You can also use style attribute to specify the width and the height of your image:
<img src="/logo.png" alt="Path to Salesforce Logo" style="width:120px; height:120px;">