Page Layout

                  The purists will tell you that HTML was not designed to described how a page should look,and they'd be right, it wasn't, but with every release Netscape and Microsoft add new HTML tags designed to increase the control the author has over how the page will appear. See Netscape's or Microsoft's pages for the very latest tags. Dynamic HTML is the latest, but Microsoft DHTML is different from Netscape HTML and DHTML is only supported by the 4.x/5.x series browsers. Cascading Style Sheets (CSS) are another page design feature. When validating this page I am told "In HTML 4.0, FONT is deprecated. It may become obsolete in future versions, consider using style sheets instead.". I've had limited experience of using CSS. They are very powerful, but can make a mess of the page when viewed in older browsers, so I'll not mention them further. I'm also avoiding any mention of frames...

You should avoid browser specific tags if they mean that a visitor to your page with a different browser will not be able to see relevant items on your page.

Here's a quick run down of some more widely supported page layout techniques

Font Colour and Size

Netscape/MeSsIE 2.0 and beyond allow you to specify the FONT size and colour

<FONT size=5 color="#FF00FF"></FONT>

The FONT size can be expressed as one of 1-7 with 3 the normal base FONT. Font size can also expressed relative to the base FONT -2,-1,+1,+2,+3,+4

1 2 3 4 5 6 7

Although MeSsIE 2.0/3.x/4.x and Netscape 2.0/3.0/4.x allow the use of color="red" etc, MeSsIE and Netscape use slightly different names. Only the hexadecimal can be read by older browsers and is needed in some circumstances (e.g. bgcolor and links). To reach the widest audience use hexadecimal. Editing colour is built into most of the current HTML editors and the need for standalone colour pickers has diminished.

Font Faces

Netscape 3.x/4.x and MeSsIE 2.0/3.x/4.x allow you to specify a specific FONT. This of course depends on your visitor having a browser that supports this feature and a having that particular FONT installed.

<FONT size=5 color="#FF00FF" face="Comic Sans MS">Comic Sans MS</FONT>

Spaces

The humble non-breaking space is ignored by many introductions to HTML. It is represented by &nbsp; and creates a space e.g.

No space 
 1 space&nbsp;
  2 spaces&nbsp;&nbsp;
   3 spaces&nbsp;&nbsp;&nbsp;
    4 spaces&nbsp;&nbsp;&nbsp;&nbsp;
     5 spaces&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

How have I achieved the above layout? Well I used a table with border=0

With border=1 it looks like this:

No space 
 1 space&nbsp;
  2 spaces&nbsp;&nbsp;
   3 spaces&nbsp;&nbsp;&nbsp;
    4 spaces&nbsp;&nbsp;&nbsp;&nbsp;
     5 spaces&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

Use View/Source to look at the code if you're interested. It could look like this (<TD align=right> in the right column>

No space 
 1 space&nbsp;
  2 spaces&nbsp;&nbsp;
   3 spaces&nbsp;&nbsp;&nbsp;
    4 spaces&nbsp;&nbsp;&nbsp;&nbsp;
     5 spaces&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

or this (<TABLE border=1 width=75> <TD align=center> )

No space 
 1 space&nbsp;
  2 spaces&nbsp;&nbsp;
   3 spaces&nbsp;&nbsp;&nbsp;
    4 spaces&nbsp;&nbsp;&nbsp;&nbsp;
     5 spaces&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

Hide the border again

<TABLE border=0 width=75> <TD align=center>

No space 
 1 space&nbsp;
  2 spaces&nbsp;&nbsp;
   3 spaces&nbsp;&nbsp;&nbsp;
    4 spaces&nbsp;&nbsp;&nbsp;&nbsp;
     5 spaces&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

It works with images as well:

TD align=leftTD align=centerTD align=right

M
A
R
G
I
N
The main document
You may have already have noticed that this whole page is enclosed within a table to give a margin effect. I've run into problems with JavaScipt enclosed in tables.

Some of the other pages in this series achieve the same margin effect by using a 1x1 transparent "stretched" image <IMAGE SRC="white.gif" WIDTH=75 HEIGHT=1200">. The problem with this approach is that the image height needs to be adjusted for every page and the page "height" differs according to the font being used to display the page and even on my machine it differs between Netscape and MSIE.

Tables, especially with the incorporation of colour elements, give you a great deal of control over how your page is laid out. Use it wisely!

[ABG HOME | Images | Background Images | Colours | Tables | Page Layout ]


© 1998 Zymous.