Images

To display an image on a website, <img /> element is used. Two important attributes contained in the <img /> element, i.e. src and alt. src attribute indentify the image to be displayed (by referring to the image name), and alt attribute specify the text to be displayed on the website if the image cannot be loaded by the browser.

For example, we want  to display an image mypicture.jpg, so write the following:

<img src=”mypicture.jpg” alt=”this is the picture of mine.” />

Apart from just being displayed, an image may also be used as a hyperlink. This is especially true if we want to direct the browser to the other website after a user clicks on an image. Here is the example:

<a href=”http://developawebsite.wordpress.com” > <img src=”mypicture.jpg” alt=”this is a picture of mine.” /> </a>

When a user clicks on the image, the browser will display this informative and useful blog again! :)

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s


Follow

Get every new post delivered to your Inbox.