z-index is absolutely nothing to do with the element "rendering" order. ( as your title suggests) What you are talking about is the normal flow of elements, andassuming no z-index used
With no POSITIONING and therefore no stacking order (z-index) changes, all elements will be in the same plane (0).html element higher on the page ie closer to the head appear above or below a 'lower' element?
z-index is absolutely nothing to do with the element "
wow, now i'm confused!
when you say in the same plane(0) do you mean as read on the screen i.e. top of screen (top of html page) is on top , bottom of screen is on bottom? i'm assuming so.
z-index is absolutely nothing to do with the element
ok, i think i get it now after thinking about it and trying a few things. many many thanks. the only weird thing i encountered was ... two elements which are absolutely positioned seem to reverse the normal rule and the lower element on the HTML appears 'above' the other.
i thought maybe this was because the browser renders the first element as absolute, then gets to the second element and it is also absolute so i sort of gets reset at the top again.
any thoughts?
greg
z-index is absolutely nothing to do with the element "
wow, now i'm confused!
when you say in the same plane(0) do you mean as read on the screen i.e. top of screen (top of html page) is on top , bottom of screen is on bottom? i'm assuming so.
No, HTML documents are far more than a flat object is, say sheet of paper.
The dimensions width and height, as applied to elements, make more sense in the real world thinking when you consider them as the width being the distance between the left and right edges, and the height being analogous to the LENGTH of the object eg: the distance from the top edge to the bottom edge.
This leaves you free to consider that z-index determines the elevation of the element ie: The distance from ground level (0) to the point furthest from level 0.
It is a curious concept BUT when you treat the document as a three dimensional object, like a cube or a box, rather than thinking of it as a two dimensional object like a sheet of paper, it begins to make sense.
z-index is absolutely nothing to do with the element
ok, i think i get it now after thinking about it and trying a few things. many many thanks. the only weird thing i encountered was ... two elements which are absolutely positioned seem to reverse the normal rule and the lower element on the HTML appears 'above' the other.
i thought maybe this was because the browser renders the first element as absolute, then gets to the second element and it is also absolute so i sort of gets reset at the top again.
any thoughts?
greg
Absolute positioning or fixed takes elements out of the normal flow so they do not affect, nor are they affected by. other elements. so they exist in a seperate plane that is relative to the body element, UNLESS there is an ancestor element is positioned other than static.
http://examples.webmaster-talk.eu/chris-hirst/css/positioning/absolute/
Absolute positioning or fixed takes elements out of the normal flow so they do not affect, nor are they affected by. other elements. so they exist in a seperate plane that is relative to the body element, UNLESS there is an ancestor element is positioned other than static.
in case it hasnt been made very clear to you.
an absolute positioned element is taken out of the document flow.
Thanks, and so if the 'green' div came first in the HTML, that would appear under the pink, right? Because the rendering engine gets to it first.
Sorry to be such a numbskull BTW. And thanks for your patience.
g
yep and for clarification.in case it hasnt been made very clear to you.
an absolute positioned element is taken out of the document flow.
Thanks, and so if the 'green' div came first in the HTML, that would appear under the pink, right? Because the rendering engine gets to it first.
<body> << start of layer level 0
<div>
<div>
</div> << this tag is NOT being a direct ancestor of body so does NOT alter the stack level
</div> << plus one (level 1)
<p>
</p> <<< plus one (level 2)
</body> << end of flow.