Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


advertisement
 

Optimizing the HTML Code

You can do some simple things with your HTML tags to make graphics feel faster and work better for all readers.


advertisement
he image tag, <img> offers several attributes that you should always include for best use of graphics:

Attribute: What it does:
width

<img src="trees.jpg" width="100">

Specifies the width of the graphic you are inserting into the page. Using this attribute lets the browser quickly make a space for the image, then go on loading the rest of the page.
height



<img src="trees.jpg" width="100" height="300">

Specifies the height of the graphic you are inserting into the page. Using this attribute lets the browser quickly make a space for the image, then go on loading the rest of the page.
alternate text (alt)

<img src="trees.jpg" width="100" height="300" alt="photo of redwood trees">

Text that displays when the graphic is broken, when the reader has graphics turned off, or when the reader uses an alternative viewing device. Ensures that your page is usable without the graphic and is accessible to people who can't see the graphic.

In addition, the size of the image in the graphic file and the size you use it in your page should always match.

Finally, put your image files together, in some logical and easy-to-find location.





Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date