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.




<img src="logo.png" />


Attribute Description Value
src Specifies URL for image “” 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


<!DOCTYPE html>
		<title>My Document Title</title>
		<img src="/images/logo.png" title="My Logo!" />

Save & refresh browser:

Leave a Reply