Page Layout, Margins, Indenting, and Columns
|
The commonest type of question asked about web page design is
"How can I indent text?" or "How can I make columns?" or "How
can I make
margins?".
These are all layout issues, which
HTML
was not originally designed to address. However, some
techniques are available to solve these problems.
|
HTML
was originally designed as a 'markup' language to represent the
logical structure of documents in terms of headings, lists, etc.
Since some elements of HTML
were commonly rendered with similar
layouts, e.g. indenting of BLOCKQUOTE, these were pressed into
use for layout solutions by web page designers. However the
official HTML specifications
do not demand these specific renderings, and
although the most popular browsers might indeed implement the layout
with indenting, this is not guaranteed to be true of all browsers.
Some browser manufacturers
tried to solve the problem with proprietary tags but this doesn't improve the
situation for web page designers who want their pages to be browser-independent.
The first step to insuring browser independence is to
validate
your pages against a publically available
HTML DTD such as those
available at the
W3C Validation Service.
The second is to avoid reliance on structural HTML tags that happen to have specific layouts.
The general situation is improving markedly with the advent of both
HTML 4.0, and
cascading style sheets.
HTML
wasn't designed with desktop publishing requirements in mind, and
so anything to get precise layout in standard HTML is going to be a
kludge, and until
HTML 4
is widely deployed you'll either have to kludge it or insist that your
audience uses a
browser
that implements much of HTML 4 such as the
latest release of
Microsoft Internet Explorer.
Style sheets,
would probably be best if your audience uses the latest NS or MS
or other style sheets browser.
See for example,
padding, borders, and margins.
I'll illustrate a few techniques here. You will probably want to
experiment with them individually and with combinations of them.
- Hacks
- Tables
- Style Sheets
Page Layout: Hacks
|