PDA

View Full Version : Question About Layer Order When Nesting DIVS



Doctor_Varney
Sep 13th, 2010, 04:20 AM
In the following markup:


<div id="layer_c">
<div id="layer_b">
<div id="layer_a">
&nbsp;
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Pellentesque cursus tellus in libero sollicitudin pharetra.
Cras aliquam mauris porta orci feugiat consequat.
Aenean accumsan tristique auctor. Proin ante sem,
varius vitae fringilla vel, rutrum in metus. Curabitur
euismod nunc in nisi hendrerit lacinia in sed nibh.
Donec mollis cursus tortor, eget volutpat massa
aliquet ac. Ut quis mi lectus. Phasellus vulputate
quam quis nunc dapibus sodales. Vestibulum hendrerit
pulvinar enim, at faucibus risus scelerisque vitae.
Nullam consequat mollis nunc et malesuada.
Maecenas et lorem ac sem convallis dignissim.
Pellentesque ut diam risus, sit amet gravida orci.
Etiam commodo lacinia suscipit. Phasellus ornare
vulputate arcu a mattis. Proin sem sem, accumsan
non bibendum nec, tempor ac justo. Mauris tempor
luctus urna, vel porta nunc blandit eu.<br>
Generated 1 paragraph, 125 words, 854 bytes of Lorem Ipsum
</p>
</div><!--end #layer_a-->
</div><!--end #layer_b-->
</div><!--end #layer_c-->


Which layer is in front?

Dr. V

Lerura
Sep 13th, 2010, 03:20 PM
layer_a is in front.

If you imagine that each element is a little piece of paper.
You first place layer_c on the table.
upon(in-doc: inside) that you place layer_b.
And last you place layer_a.
and then you have a <p> that you place upon layer_a.

the stack of papers then have layer_c at the bottom(in the back) and the <P> at the top (in the front)