Ryan's District
November 22, 2008, 07:14:36 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Ryan's District Lottery: Claim your ticket or check
Jackpot details  
 
   Home   Help Search Chat Calendar Chess Shop Login Register  
Digg This!
Pages: [1]   Go Down
  Send this topic  |  Print  
Author Topic: HTML lesson - how to include images in web pages part 1  (Read 2834 times)
0 Members and 1 Guest are viewing this topic.
ben2ong2
Quality Poster
Paid
Hero Member
*****

Reputation: 17
Offline Offline

Gender: Male
Posts: 2374
9976.80 RD$

View Inventory
Send Money to ben2ong2

View Profile Awards
« on: October 03, 2006, 05:10:50 PM »

Including images is very simple. You employ the <IMG> tag. The required attribute of this tag is SRC, which takes the value of the image file's URL.

<IMG SRC="ash.jpg">

The SRC attribute determines the source of the image file and takes a URL as value. I have used a relative URL which shows that ash.jpg is located in the same directory as this file.

Three kinds of images files .gif, .jpg and .png are used on the Internet. A general rule of thumb is to use .jpgs for photographs and .gifs for images containing large blocks of single colors.

The <IMG> tag has many attributes

WIDTH: used for specifying the width of the image
HEIGHT: specifies height
BORDER: displays a border around the image
ALT: helps to insert a descriptive text for users using text based browsers or for visitors with visual disabilities.
HSPACE: inserts space at the left and right of the image
VSPACE: inserts space at the top and bottom of the image
NAME: gives a name to the image; necessary for client-side scripting using JavaScript
LOWSRC: provides a method through which a low quality alternate of the image is displayed first before the final one starts to load.
ALIGN: aligns other HTML elements such as text around the image.


The size attributes, WIDTH and HEIGHT
The WIDTH and HEIGHT attributes take pixel dimensions of the image as values. You can find the width and the height of the image in pixels using a graphics program such as Paint Shop Pro or Adobe PhotoShop.

Your image will display correctly even if you skip using these attributes. However, you should ALWAYS include them as this helps the browser window to allocate space for your image.

The image is distorted! It means that the width and height attributes force the image to be displayed in that space regardless of what the actual dimensions are.



BORDER attribute
Use this attribute to put a border around the image. The attribute takes a number as value. This number determines the thickness of the border in pixels.


ALT attribute
According to the World Wide Web Consortium, the ALT atribute is now required. You can put some advisory text with the use of this attribute. This text is displayed when the mouse pointer is placed on the image. You should get into the good habit of including ALT tags. Why? Read on...

Visitors using text-based browsers or who have turned off images in their browsers will not be able to see the image. However, they would be able to read the image description through the ALT attribute. Also, the ALT attribute value will be read by speech browsers, employed by visually impaired visitors. So be a good developer and insert the ALT attribute always.

Logged

You are not allowed to view links.
Register or Login
Free Paid Survey & Home Business Resources.

You are not allowed to view links.
Register or Login
Free Article Directory | Quality Content
Ryan's District
« on: October 03, 2006, 05:10:50 PM »

 Logged
Pages: [1]   Go Up
  Send this topic  |  Print  
 
Jump to:  

Archive - WAP2 - WAP - imode
Sponsors: RAYAN.tv
-

Powered by MySQL Powered by PHP Powered by SMF 1.1.7 | SMF © 2006-2008, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Page created in 5.049 seconds with 31 queries.

Google visited last this page Yesterday at 08:36:25 AM