Neil Macmillan and Associates Logo

Neil Macmillan & Associates

Image Alignment on HTML Pages

New! Web Graphic Design Books now available from
The Webmaster's Bookstore

Alignment Options

Top
Middle
Bottom
Right
Left
Space Control

Image Source

To use a graphic with a page of HTML text, use the markup
<IMG SRC = "source & file type of the image">

The source of the image is defined by where the image is relative to the main document. The simplest situation is where the image is in the same directory as the main document. Then the image source is simply the name of the image file and its file type:
<IMG HEIGHT=140 WIDTH=125 SRC = "koala.jpg">.

If images are stored in a separate "graphics" directory/folder on the server:
<IMG HEIGHT=140 WIDTH=125 SRC = "graphics/koala.jpg">.

Picture of bearPicture of bear
NOTE:
It is good practice to specify
the height and width of an image in pixels.
This will let the page load much faster.

In the second image, the Markup,
<IMG HEIGHT=140 WIDTH=125 BORDER=2 SRC="koala.jpg>
creates a 2-pixel border round the image.


ALIGN=TOP

HTML: <IMG HEIGHT=140 WIDTH=125 SRC="graphics/koala.jpg" ALIGN=TOP>

Some text here Picture of bear More text here. But you will note that the next line of text jumps from the top right of the document to the bottom of the image.

We will learn how to use ALIGN=LEFT and ALIGN=RIGHT to overcome this problem.


ALIGN=MIDDLE

HTML: <IMG HEIGHT=140 WIDTH=125 SRC="graphics/koala.jpg" ALIGN=MIDDLE>

Some text here Picture of bear More text here


ALIGN=BOTTOM

HTML: <IMG HEIGHT=140 WIDTH=125 SRC="graphics/koala.jpg" ALIGN=BOTTOM>

Some text here Picture of bear More text here


We will now study ways of positioning images within blocks of text

ALIGN=LEFT

HTML: <IMG HEIGHT=140 WIDTH=125 SRC="graphics/koala.jpg" ALIGN=LEFT>

Picture of bear We will now place here related to the subject of koalas. We will now place all manner of text here related to the subject of koalas. We will now place all manner of text here related to the subject of koalas. We will now place text here related to the subject of koalas. We will now place all manner of text here related to the subject of koalas. We will now place text here related to the subject of koalas. We will now place all manner of text here related to the subject of koalas. We will now place text here related to the subject of koalas. We will now place all manner of text here related to the subject of koalas. We will now place here related to the subject of koalas. We will now place all manner of text here related to the subject of koalas. We will now place here related to the subject of koalas. We will now place all manner of text here related to the subject of koalas.


ALIGN=RIGHT

HTML: <IMG HEIGHT=140 WIDTH=125 SRC="graphics/koala.jpg" ALIGN=RIGHT>

Picture of bearWe will now place all manner of text here related to the subject of koalas. We will now place all manner of text here related to the subject of koalas.We will now place here related to the subject of koalas. We will now place all manner of text here related to the subject of koalas. We will now place all manner of text here related to the subject of koalas. We will now place all manner of text here related to the subject of koalas. We will now place all manner of text here related to the subject of koalas. We will now place all manner of text here related to the subject of koalas. We will now place text here related to the subject of koalas. We will now place text here related to the subject of koalas. We will now place all manner of text here related to the subject of koalas.


ALIGN=RIGHT With Space Control

HTML: <IMG HEIGHT=140 WIDTH=125 SRC="graphics/koala.jpg" ALIGN=RIGHT HSPACE=50 VSPACE=50>

Picture of bearThe effect of the < HSPACE=50 VSPACE=50> portion of the Markup is to create an invisible border round the image of 50 pixels. Horizontal and Vertical spacing is controlled independently, using HSPACE= and VSPACE=, respectively.

We will now place all manner of text here related to the subject of koalas. We will now place text here related to the subject of koalas.We can now place some text here related to the subject of koalas. We will now place all manner of text here related to the subject of koalas. We will now place all manner of text here related to the subject of koalas. We will now place all manner of text here related to the subject of koalas. We will now place all manner of text here related to the subject of koalas. We will now place all manner of text here related to the subject of koalas. We will now place text here related to the subject of koalas. We will now place text here related to the subject of koalas. We will now place all manner of text here related to the subject of koalas.

Graphical Menupointer
Top of This Page
web site designer consulting and training services  Neil Macmillan & Associates web site designer
HOME PAGE || SITE MAP || CONTACT US
Internet marketing consultantsWeb Site Design  Internet marketing consultantsWWW Marketing  Internet marketing consultantsInternet Training
1129 Selkirk Drive Nanaimo, BC, Canada V9R 5X4
webmaster@nmacmillan.com
250.753.7293
Home Page Consulting Services Table of Contents International Portfolio Bookmark Newsletter Awards, Associates, etc. Free Inquiry Form Internet Marketing Resource Room Developing an Internet Web Site Features of an Internet Marketing Web Site HTML Help Centre Transparent GIFs Tutorial Cascading Style Sheets Tutorial Image Alignment Tutorial Web Page Refinements The Webmasters Bookstore Weave a Web Page Outline HTML Enhancements Class Outline Search Tools List

http://www.nmacmillan.com/images.htm
Updated: Jan 09 1998