HTML Image Tag

by admin on 2009/08/03

 

Example Of The Html Image Tag

The html image tag is used by website designers to display images on a webpage. The image tag can be a basic tag but you can also add other elements to it for the users benefit as well as google. This is an example of the image tag at its basic level:

<img src=”sourcefile.jpg”>

That tag is telling the website to display an image (img) from a particular source (src) that I have called “sourcefile”.

Depending on where your image is stored on your server you may need to include the folder as well, so the tag would look like this:

<img src=”imagefolder/sourcefile.jpg”>

All I have done to is include the folder before the image file itself so this tells the webpage to look in folder “imagefolder” for a file called “sourcefile”. You can also use the html image tag to display an image from another site, all you have to do is add the url like this:

<img src=”http;//directorysubmissions.eu/imagefolder/sourcefile.jpg”>

That concludes how to display an image using the image tag but now I will show you what you can do to tweak it slightly for google and the other search engines.

What I will show you now will give the image a title which is displayed when a user hovers over the image and will show up when google crawls your site. All I’m going to do to the above example is add a title tag within the image tag.

<img src=”sourcefile.jpg” title=”Source File Name or Keyword”>

You can also add an “alt” tag which is an alternative element which displays text if the image cant be displayed.

<img src=”sourcefile.jpg” title=”Source File Name or Keyword” alt=”Image of flowers”>

So if for any reason the image wont display it will show the text “image of flowers” which is good as it tells your users what should of been there and it also tells google what the image is.

Leave a Comment

Previous post: Link Traffic Builders

Next post: Star Marketing Website Promotion