Return to our main pageGet an overview of the 100s of pages on this siteAn alphabetic index of our 100s of pagesSearch this siteby email, snail-mail or phoneThe people at NetKontoret

Tutorial and Inspection of your own siteTutorial and Script-archiveTutorial and Applet-archiveTutorial and FLA-archiveTutorial and Graphics-archiveFree Email, Webspace, Programs, Applets, Graphics and CGIWebdesign, Teaching and Consulting

 
 Home|WebSchool|HTML|Images



Click To Recomend This Site To A Friend
Tell a friend about this site!!!

Bookmarks on this page

 
 Images (GIF&JPG)
 
 Inserting
 
 Resizing
 
 Border
 
 Alternative Text
 
 Spacing
 
 Alignments
 
 Wrap Text Around

Pages in this section

 
Basic Coding
 
Text
 
Lists
 
Images
 
Links
 
BackGrounds
 
Tables
 
Frames
 
Forms
 
Metatags
 
Hexcolors
 
Inspect your own site
 
Others & Links


HTML IMAGES

pixel.gif (43 bytes) d10.gif (111 bytes)

Images

This section will show how to add images to your pages.

If you want to learn how to make images work as links, you should go to the links-section.

If you want to learn about browser-safe colors for images, you should go to the HexColor-section.

Top of page


Web-Images (GIF and JPG):

Computers can store images in many different ways.

Some storagemethods are focused on compressing the size of the image as musch as possible.

These are the image-formats that are interesting to web-publishing, since a major problem with images on websites is that images are way more expensive (in transfer-time) than text.

To reduce downloadtimes as much as possible two of the best image-compressing-formats are used on the web:

GIF JPG
256 colors. Unlimitted colors.
Can handle transparent areas Can't handle transparent areas
The format is not good at compressing photographs Excellent for compressing photographs and complex images
In general it is excellent for banners, buttons and cliparts. In general it is not good for banners, buttons and cliparts


This means that banners, buttons, dividers, cliparts and other simple images usually works best as GIF's.
Photographs and other complex images usually works best as JPG's.

If you want to use an image in another format than JPG or GIF you need to load the image into a graphic program and then save it as either JPG or GIF.

Click here to learn more about the limited amount of colors on webpages - in particular, the limited numbers of colors that looks the same on all browsers.

Top of page


INSERTING AN IMAGE ON A WEBPAGE:
The tag used to insert an image is called img.

Below you see an image called "rainbow.gif".
Underneath is the HTML-code used to insert the image on this webpage:

rainbow.gif (2273 bytes)


<img src="http://www.netkontoret.dk/rainbow.gif">

 

Top of page


RESIZING IMAGES:
It is possible to change the size of an image using the Width- and Height-attributes.

In general it is not adviseable to reduce imagesize using these settings, since the image that needs to be transfered over the internet is the original image, no matter what reduction might be added to it when inserted on the page.

This means, that if you have an image that is bigger in size than you want it to be on your page, you should reduce the imagesize in a graphics program, rather than reduce the size on the webpage using the width and height-attributes.

On the contrary, sometimes, it can be wise to enlarge images using this technique.

Below is exactly the same image as shown above.. only with different settings for width and height. (Note: Original dimensions are 60x60)

rainbow.gif (2273 bytes)

 

<img src="http://www.netkontoret.dk/rainbow.gif" width="120" height="120">

Top of page


BORDER AND ALTERNATIVE TEXT TO IMAGE:
You can add a border or an alternative text to the image using the tags shown in the example below:

Note:
Netscape-browsers only show border if the image is used as a link.

This is a text that goes with the image

 

<img src="http://www.netkontoret.dk/rainbow.gif" alt="this is a text that goes with the image" border="5">

 

Top of page


SPACE AROUND THE IMAGE:
If you want to add space over and under the image you can use the Vspace-attribute.

In a similar way you can add space to the left and right of the image using the Hspace-attribute.

Below is an example using these attributes:

 

<img src="http://www.netkontoret.dk/rainbow.gif" Hspace="30" Vspace="10">

 

Top of page


ALIGNMENT OF IMAGES:
It is possible to align the image according to the text around it, using the following alignments:

  • default aligns the image using the default settings of the Web browser. Same as baseline.
  • left aligns the image in the left margin and wraps the text that follows the image.
  • right aligns the image in the right margin and wraps the text that precedes the image.
  • top aligns the top of the image with the surrounding text.
  • texttop aligns the top of the image with the top of the tallest text in the line.
  • middle aligns the middle of the image with the surrounding text.
  • absmiddle aligns the image with the middle of the current line.
  • baseline aligns the image with the baseline of the current line.
  • bottom aligns the bottom of the image with the surrounding text.
  • absbottom aligns the image with the bottom of the current line.
  • center aligns the center of the image with the surrounding test.

In the table below you will see the different vertical alignments you can make for an image.

The node node.gif (994 bytes) in the examples is only there to show how the circular sign texttop aligned image is affected by other images on the same line. This means, that the alignments shown in the example are made to the circular sign and not the note.

Note:
texttop
, middle, bottom and baseline aligns the image only to the text on the relevant line.
top, absmiddle and absbottom aligns the image to whatever is present on the relevant line.

<img src="rainbow.gif" align="texttop"> bla node.gif (994 bytes)bla texttop aligned imagebla bla
<img src="rainbow.gif" align="top"> bla node.gif (994 bytes)bla top aligned imagebla bla


 
<img src="rainbow.gif" align="middle">

 

bla node.gif (994 bytes)bla middle aligned imagebla bla
<img src="rainbow.gif" align="absmiddle"> bla node.gif (994 bytes)bla absmiddle aligned imagebla bla
 
<img src="rainbow.gif" align="bottom"> bla node.gif (994 bytes)bla bottom aligned imagebla bla
<img src="rainbow.gif" align="absbottom"> bla node.gif (994 bytes)bla absbottom aligned imagebla bla
<img src="rainbow.gif" align="baseline"> bla node.gif (994 bytes)bla baseline aligned imagebla bla

 

Top of page


WRAPPING TEXT AROUND IMAGES

Despite from vertical alignments, images can also be aligned horizontally.

To do this, add align="left" or align="right" to the <img>-tag.

Another way to obtain the same effect would be to enter the image and text in an invisible table. Entering text in one column and the image in another would create a similar effect.

<img src="rainbow.gif" align="left">bla bla bla
bla bla bla bla bla bla bla bla bla bla bla bla
left aligned imagebla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla
bla bla bla bla bla bla bla bla bla bla bla bla bla
bla bla bla<img src="rainbow.gif" align="right">
right aligned imagebla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla

 

 

Click To Recomend This Site To A Friend
Tell a friend about this site!!!

d10.gif (111 bytes) pixel.gif (43 bytes)



     

menumidline.gif (281 bytes)



| Home | SiteMap | Index | Search | Contact Us | About Us | E-Mail Us |
| HTML | JavaScript | Applets | Flash | Graphics | Free Stuff | Products |


This page is created & maintained by NetKontoret / Henrik Petersen
All contents Copyright © 1997, 1998 - NetKontoret / Henrik Petersen - All Rights Reserved