|
This page shows HTML features that allow images and text to be mixed
in a flexible way, and also shows some of the things that can go wrong
and that are to be avoided!
ALIGN=left
in the
HTML ALIGN=right
will introduce an image on the right hand side of the page.This text refers to the image on the right. It might be a caption of some kind closely associated with the image.
This text refers to the image on the left.
This text refers to the image on the right.
A <BR CLEAR=right>
The incautious use of ALIGN
can lead to some unfortunate effects.
It is generally best to restrict yourself
to at most one left image or at most one right image
and just possibly one of each provided that
they are thin.
If you have an image on the left and on the right
without sufficient room for text between them, then
the text may get overwritten
or may overwrite the images
- depending on the browser.
Any way, the effect may not be pleasant
if the text runs into, under or over the images;
try page widths around 680 to 730 pixels.
If the page is narrowed, the two images and the text (above)
may overlap each other - not good.
If the page size is changed and the images remain
of a fixed size, the images may get wildly out of proportion with it
and the effect can be very ugly.
The image WIDTH
can be set to a fraction
of the page width, e.g. 50% (right),
in which case it occupies a fixed proportion of the page.
The image must be of sufficiently high resolution to look good
at the maximum page size; this one is not.
Further, the font size will not change and so the proportions
of text areas can still change -
not always with pleasant results.
Another way to control image and text layout | ||
is by using TABLES | ||
(I'm sick of the ship too but there are only two different images here so at least the page does load quickly.) | Although the effect may be too rigid, e.g. if you maximise the page, and scroll-bars will appear if you make it really narrow. |
One version of HotWired used a layout a little like this to introduce its stories. | ||
A (different) thumbnail picture for each story was placed on the left and the title and brief description were placed on the right. | ||
Some think that staggering the images and text in this way differentiates each item from its neighbours. | ||
Although others believe that it is distracting. |
The effect can be produced by using a TABLE
.
The underlying pattern is three items per row
but on the odd numbered rows the second item has
COLSPAN=2
and on the even numbered rows the first item is empty.
You can see that there is one image repeated four times here | ||
because the copies do not match at their edges but if they were 4 parts of one cut-out photograph | ||
that joined seamlessly, the text would appear to flow around an irregular image. |
Again the effect is achieved with a suitable use of a
TABLE
.
The attributes
BORDER, CELLSPACING
and CELLPADDING
are set to zero.
Gifs with transparent backgrounds
can be used to enhance this effect.
If you make the browser window extremely narrow
the text will take up several lines and the images will
be pushed apart vertically.
This can be prevented by using <NOBR>...</NOBR>
|
||||
|
A fair bit of trial and error was required to make this work under N3. Will it work under N4 and MS Explorer?
If you have a number of images
of different sizes
the effect of the unaligned edges
can create an untidy effect.
Aligning the right edges | |
of the images (with a TABLE )
| |
can be less disturbing. |
Another alternative is to align | |
on the centre line of the page | |
which is strong visually. |