Images

Images are defined with the <img> tag. This is an empty tag, closed using a forward slash at the end.

 

The actual image is applied by assigning the location of the image to the src attribute.

 

Syntax:

 

<img src="logo.png" />

 

Attribute Description Value
src Specifies URL for image “https://www.site.com/logo.png” or relative URL “/images/logo.png”
id id of the image user defined
style Enables inline CSS styling CSS user defined styling
width How wide the image is 600px, 40%
height How high the image is 480px, 60%
border Sets a border around the image 1, 2, etc
title Tooltip user defined
alt Alternate text if image is missing user defined
hspace Horizontal space around the image 10px, 20px
vspace Vertical space around the image 10px, 20px
name Sets the name of the image user defined

 

Save & refresh browser:

Leave a Reply