Home arrow HTML arrow HTML Working with Images
HTML

HTML Working with Images


In our last tutorial we discussed working with forms in HTML. In this episode we will cover how to work with images, such as floating images, image maps, and background images.

Author Info:
By: James Payne
Rating: 5 stars5 stars5 stars5 stars5 stars / 6
February 22, 2008
TABLE OF CONTENTS:
  1. · HTML Working with Images
  2. · Alternatives to Images
  3. · Setting an Image as the Background
  4. · Setting Your Image as a Hyperlink

print this article
SEARCH DEVARTICLES

HTML Working with Images
(Page 1 of 4 )

Aside from making your website look pretty, images serve a number of purposes in HTML. You can use them for attractive navigational links, for backgrounds, and even to add interactivity to your website. Since font support is limited to the type of fonts a user has on their computer, images also allow for you to create images of the fonts you like and use them on your page. Be forewarned however, as the more images you put on your page, the longer it will take them to load. And too many images can make a website look busy and cluttered.

How to Insert an Image

You insert images into your web page using the <img> tag. The source part, or attribute, tells the computer where the image is located, as shown below:


<html>

<body>

<p>

Here is a sample image:

<img src="sample.gif"

width="144" height="50">

</p>

<p>

Here is the same image, only bigger:

<img src="sample.gif"

width="288" height="100">

</p>

<p>

Here is the same image, only smaller:

<img src="sample.gif"

width="77" height="50">

</p>

</body>

</html>

This code inserts three images, using the <img> tag. While all of the images are the same (sample.gif), we used the height and width properties to manipulate the size of each one, creating a normal-sized image, a small-sized image, and a large-sized image.

If you have images located in different places on your server, or another server entirely, you can link to them this way:


<html>

<body>

<p>

An image from another folder on your server:

<img src="/images/sample.gif"

width="50" height="50">

</p>

<p>

An image from another website:

<img src="http://www.devshed.com/images/sample.gif">

</p>

</body>

</html>


blog comments powered by Disqus
HTML ARTICLES

- Does HTML5 Need a Main Element?
- Revisiting the HTML5 vs. Native Debate
- HTML5: Not for Phone Apps?
- HTML5 or Native?
- Job Hunting? Freelancer.com Lists This Quart...
- HTML5 in the News
- Report: HTML5 Mobile Performance Lags
- The Top HTML5 Audio Players
- Top HTML5 Video Tutorials
- HTML5: Reasons to Learn and Use It
- More of the Top Tutorials for HTML5 Forms
- MobileAppWizard Releases HTML5 App Builder
- HTML5 Boilerplate: Working with jQuery and M...
- HTML5 Boilerplate Introduction
- New API Platform for HTML5

Watch our Tech Videos 
Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 

Developer Shed Affiliates

 




© 2003-2017 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials