0

Img

How do I link a pic correctly using html

14th Mar 2025, 8:05 PM
Christianah Asieba
Christianah Asieba - avatar
1 Respuesta
+ 1
Christianah Asieba Use the <img> html tag. You will need to include some attributes with the tag. 👉 src (required) Absolutely required. Gives the reference address for the image file. Absolute reference for image file on different server than html file. Local reference only for image file on same server as html file. 👉 alt (required) Required, though some are lazy and leave the value as empty quotes. Text description of image in case it fails to load. More important for screen readers for visually impaired users. 👉 height, width Optional but highly recommended. Allows the browser to know how big the image will be before it finishes loading, so text is not jumping all over the place. 👉 EXAMPLE - with absolute reference <img src="https://www. example. com/pics/tree.jpg" alt="old oak tree" height="400" width="300">
14th Mar 2025, 11:17 PM
Shardis Wolfe