Layers - What's wrong

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
I'd like to be able to position an element coincident with the upper left
hand corner of another. Could be overlayed text, image, whatever. It was my
understanding that layers could be used for this, but I'm clearly doing
something wrong. An example page - with styles exposed - is at

I'd like the text at the bottom to appear in the upper left hand corner of
the screen. It's appearing at the bottom of the screen instead. I'm
obviously missing something. Would someone be so kind as to point out the
error of my ways?


Re: Layers - What's wrong

Quoted text here. Click to load it

There's no such thing as a layer in HTML/CSS.

Netscape 4 had a <layer> element but that is ancient history.

Dreamweaver describes positioned <div>s as layers but it's misleading
(not least for the fact that it seems to cause a mindset in certain
people where they think that (a) only divs can be positioned and (b)
divs are only for positioning and nothing else).

At it's most harmless layer can be taken to mean any positioned
element. So why not just say that?

Quoted text here. Click to load it

positioning: absolute should be position: absolute

You also have no need to position the first div in your page at all.
Remove the body margins and padding and that div will sit snug in the
top left corner without any need for absolute positioning.


"My theories appal you, my heresies outrage you,
 I never answer letters and you don't like my tie."  - The Doctor

Re: Layers - What's wrong - Fixed (and thanks)

Steve Pugh wrote:

Quoted text here. Click to load it

Thanks much, Steve. I appreciate the help!


Site Timeline