If you need to use layers, then use them. If you want to begin using
CSS-P
methods, then use them by all means! But learn how to use them first -
http://www.thepattysite.com/layer_laws.cfm
The word "layer" was first coined by Netscape when it introduced its
heinous
and ill-fated <layer> tag with NN4x. It has since been adopted by the
community to generally refer to absolutely positioned <div> tags, and
Dreamweaver has
propagated that usage. In fact, there is really no such HTML thing as a
layer, but for the purposes of this discussion let's use the
Dreamweaver/FP
sense of applying that term to absolutely positioned <div>s.
==============================
In plain talk, a layer is like a magic carpet - it floats above your page
content (any page content, including tables, images, text, etc.). It is
unaffected by page margin settings because it is not really *on* the page.
You can whisk it around on the page to provide motion (using timelines).
You can make it visible or invisible using any of the actions appropriate
to
your browser selection (like onMouseOver, onClick, onLoad, etc.). You can
dynamically clip or scroll the contents of layers to provide a windowed
effect within a page. Layers are wondrous constructs that let you bring
your pages to life! Get to know them - they are your friends....
=================
I would add in clarification and elaboration that layers are positionable
elements and as such allow you to put content at any location you desire,
regardless of the remainder of the content on the page.
The downside to layers is the flip-side of their real benefit. Because
they
are absolutely positioned, they will be static page elements, i.e., they
will not move to reflect changes in your browser viewport size *unless*
you
apply some custom javascript to the page that makes the layers move, or
*unless* you use
specific CSS-P techniques to make them move. There
is no native support in HTML for moving layers - that's why it must be
done
with custom js or advanced CSS.
If you consider that a 'layer' is really just a 'division' or <div> tag on
the page, and that you can use
CSS to position this <div> tag, as well as control the format of its
contents and how it interacts with
other content around it, then you can see how valuable it might be for use
as a page layout tool!
This impression is certainly true. As you become more familiar with CSS,
you will learn how to
replace a large part of your current page layout methodology with pure CSS
positioned page
elements. But it's something you should take your time with. It *is* the
way of the future, so at
some point we will all have to come to grips with using CSS in this
manner.
Some people use layers exclusively for page layout because of the ease
with
which they can be positioned. I do not recommend this approach for anyone
that is new to layers or to CSS in general because it can be confusing and
troublesome. This is partucularly the case if you will have multiple
layers, each
containing nominally uncontrolled/unstyled text. Viewers resizing this
text in their
browsers will see a disappointing overlap of paragraphs that is surely NOT
what you desire.
Tables, on the other hand, are most everything that layers are not! They
are flexible page elements, in that native HTML can center, or right or
left
align a table - in other words, they can float around on your page
depending
on the browser's viewport width. Although originally added to HTML as a
means of displaying tabular data *only*, tables quickly became the
principal
structural element used in page layout. They can be made rigid in order
to
provide a stable base for your page elements, including text, images,
Flash,
etc. They are easy to use and to learn (more or less), and behave in
(mostly) predictable ways across browser and platform combinations - but
there are quirks that must be learned to use them successfully. Luckily,
most of these quirks are discussed here daily. In spite of these quirks,
however, if you intend
to be a credible web developer, you must learn how to build stable tables
with
your hands behind your back!
So - to summarize...
If you want motion on your page, you must use layers. If you want bedrock
for your page layout, you must use tables at this point. Or not
(particularly when you
consider what you can do with CSS positioned page elements and NO tables
at
all -
http://www.csszengarden.com).
Bear in mind that advanced use of these two page elements can
*significantly* blur these two criteria.
And remember, the use of one does not preclude the use of the other on the
same page.
Use them both if the spirit moves you.
There you go....