Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Relatively positioned elements and overlaping

0 views
Skip to first unread message

Claude Schneegans

unread,
May 3, 2005, 4:04:00 PM5/3/05
to
Hi,

The W3C says:
"The 'z-index' property is used to specify the stacking order of
positionable elements <#Positionable_Elements>."
and it defines positionable elements as "Elements whose 'position'
property is set to either 'absolute' or 'relative'."
<#Positionable_Elements>
Then the z-index style should work for a relative positioned SPAN for
instance, right?

Microsoft also says:
"It is quite possible that relatively positioned elements will overlap
with other objects and elements on the page. As with absolute
positioning, you can use the z-index attribute to set the *z-index* of
the positioned element relative to other elements that might occupy the
same area."

Then, in the following code, the content of the SPAN which has a z-index
of 1 should not overlap the rest of the paragraph with a x-index of 2.
What's the problem?

<P STYLE="position:relative; z-index:2; background-color: Aqua;">This
text should not be<SPAN STYLE="position: relative; z-index:1;
left:-50px; background-color: #ECE9D8;">overlaped</SPAN></P>.

Adrienne

unread,
May 4, 2005, 12:06:17 AM5/4/05
to
Gazing into my crystal ball I observed Claude Schneegans
<schne...@internetique.com> writing in news:uKRz5sBUFHA.952
@TK2MSFTNGP10.phx.gbl:

Span is an inline element. AFIAK z-index would apply only to block level
elements.

--
Adrienne Boswell
http://www.cavalcade-of-coding.info
Please respond to the group so others can share

Claude Schneegans

unread,
May 4, 2005, 9:56:35 AM5/4/05
to
>AFIAK z-index would apply only to block level elements.

It looks like is is the problem, why don't they say so in the docs?

Thanks.

Adrienne

unread,
May 4, 2005, 11:40:14 AM5/4/05
to
Gazing into my crystal ball I observed Claude Schneegans
<schne...@internetique.com> writing in news:#3BvhELUFHA.752
@TK2MSFTNGP10.phx.gbl:

> >AFIAK z-index would apply only to block level elements.
>
> It looks like is is the problem, why don't they say so in the docs?
>
> Thanks.
>

It is not a problem, it is the nature of block level and inline elements.
Of course, one can always style a block level element to _look_ like an
inline one.

Claude Schneegans

unread,
May 4, 2005, 12:04:03 PM5/4/05
to
>>It is not a problem,

Well, for the time being, it is a problem for me ;-)

>>Of course, one can always style a block level element to _look_ like an
inline one.

In my case I would need LI elements to _look_ like block elements and give them
the z-index levels I want. I gave them display:block; to no avail: the z-index
still has no effect.

Adrienne

unread,
May 4, 2005, 1:28:22 PM5/4/05
to
Gazing into my crystal ball I observed Claude Schneegans
<schne...@internetique.com> writing in
news:#D3ioLMU...@TK2MSFTNGP15.phx.gbl:

URL?

Claude Schneegans

unread,
May 4, 2005, 4:11:26 PM5/4/05
to
Please look at http://www.contentbox.com/claude/test/zIndex.htm

I'm trying to get item 1.1, item 1.2 and item 1.3 to overlap item 2 and 3.

0 new messages