Go Back   Wiki NewForum | Latest Entertainment News > Career Forum & Tips > Tech Forum & Tutorial > HTML Forum & Tutorial


HTML Images


Reply
Views: 4540  
Thread Tools Rate Thread
  #1  
Old 05-03-2009, 11:48 AM
welcomewiki welcomewiki is offline
Member
 
Join Date: Dec 2008
Location: India
Posts: 80,566
Default HTML Images

Example

Norwegian Mountain Trip



Try it Yourself - Examples


Insert images
This example demonstrates how to display images in your Web page.
Insert images from different locations
This example demonstrates how to display images from another folder or another server in your Web page.
(You can find more examples at the bottom of this page)

The Image Tag and the Src Attribute

In HTML, images are defined with the tag.
The tag is empty, which means that it contains attributes only and it has no closing tag.
To display an image on a page, you need to use the src attribute. Src stands for "source". The value of the src attribute is the URL of the image you want to display on your page.

The syntax of defining an image:

The URL points to the location where the image is stored. An image named "boat.gif" located in the directory "

The browser puts the image where the image tag occurs in the document. If you put an image tag between two paragraphs, the browser shows the first paragraph, then the image, and then the second paragraph.

The Alt Attribute

The alt attribute is used to define an "alternate text" for an image. The value of the alt attribute is an author-defined text:

Big Boat The "alt" attribute tells the reader what he or she is missing on a page if the browser can't load images. The browser will then display the alternate text instead of the image. It is a good practice to include the "alt" attribute for each image on a page, to improve the display and usefulness of your document for people who have text-only browsers.
Basic Notes - Useful Tips

If an HTML file contains ten images - eleven files are required to display the page right. Loading images take time, so my best advice is: Use images carefully.

Reply With Quote
  #2  
Old 05-03-2009, 11:49 AM
welcomewiki welcomewiki is offline
Member
 
Join Date: Dec 2008
Location: India
Posts: 80,566
Background image

This example demonstrates how to add a background image to an HTML page.




Look: A background image!



Both gif and jpg files can be used as HTML backgrounds.



If the image is smaller than the page, the image will repeat itself.








------

Look: A background image!

Both gif and jpg files can be used as HTML backgrounds.
If the image is smaller than the page, the image will repeat itself.
Reply With Quote
  #3  
Old 05-03-2009, 11:50 AM
welcomewiki welcomewiki is offline
Member
 
Join Date: Dec 2008
Location: India
Posts: 80,566
More Examples

Background image
This example demonstrates how to add a background image to an HTML page.


Aligning images
This example demonstrates how to align an image within the text.


Let the image float
This example demonstrates how to let an image float to the left or right of a paragraph.


Adjust images to different sizes
This example demonstrates how to adjust images to different sizes.


Display an alternate text for an image
This example demonstrates how to display an alternate text for an image. The "alt" attribute tells the reader what he or she is missing on a page if the browser can't load images. It is a good practice to include the "alt" attribute for each image on a page.


Make a hyperlink of an image
This example demonstrates how to use an image as a link.


Create an image map
This example demonstrates how to create an image map, with clickable regions. Each of the regions is a hyperlink.


Turn an image into an image map
This example demonstrates how to turn an image into an image map. You will see that if you move the mouse over the image, the coordinates will be displayed on the status bar.





CLICK NEXT PAGE FOR CODE
Reply With Quote
  #4  
Old 05-03-2009, 11:50 AM
welcomewiki welcomewiki is offline
Member
 
Join Date: Dec 2008
Location: India
Posts: 80,566



Look: A background image!



Both gif and jpg files can be used as HTML backgrounds.



If the image is smaller than the page, the image will repeat itself.




Reply With Quote
  #5  
Old 05-03-2009, 11:51 AM
welcomewiki welcomewiki is offline
Member
 
Join Date: Dec 2008
Location: India
Posts: 80,566




An image
align="bottom" width="48" height="48">
in the text




An image
align="middle" width="48" height="48">
in the text




An image
align="top" width="48" height="48">
in the text



Note that bottom alignment is the default alignment




An image
width="48" height="48">
in the text




width="48" height="48">
An image before the text




An image after the text
width="48" height="48">




Reply With Quote
Reply

New topics in HTML Forum & Tutorial





Powered by vBulletin® Version 3.8.10
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
WikiNewForum)