Locked lesson.
About this lesson
Exercise files
Download this lesson’s related exercise files.
Using Images.docx59.1 KB Using Images - Solution.docx
59 KB
Quick reference
Using Images
Add images to your web page using the image tag.
When to use
Whenever you want to add images to your web page, you will use the image tag.
Instructions
To add an image use the image tag:
<img src="image.png">
To designate the image display size, use the height and width attribute in the image tag:
<img src="image.png" height="150" width="200">
To add a title to the image, use the title attribute:
<img src="image.png" height="150" width="200" title="Me Hiking Outside Vegas!">
Create a folder to store all of your images.
You can also resize the actual image in photoshop to optimize your website for speed.
Hints & tips
- Image tag: <img src="image.png">
- Image tag with sizes: <img src="hike.png" height="150" width="200">
- Image tag with sizes and a title: <img src="hike.png" height="150" width="200" title="Me hiking!">
- Image tags do not contain a closing tag, they stand alone.
Lesson notes are only available for subscribers.