MMDT1021 Chapter 6 Notes - page 1

Inserting Images on a Page and Offering Alternate Text

Adding an image
Code Result
<img src="images/world.jpg" />

 

Adding alternative text
Code Result
<img src="images/world.jpg" alt="Second Image Text" /> Second Image Text

 

Adding a border
Code Result
<img src="images/world.jpg" border="5" alt="Third Image Text" /> Third Image Text

 

Specifying Size for Speedier Viewing

If you tell the browser how many pixels wide and high a picture is, the browser can then draw the page quicker.
Code Page
Here is a page without the use of width= and height= attributes. Result
Source
Here is a page with the use of width= and height= attributes. Result
Source