468,140 Members | 1,477 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,140 developers. It's quick & easy.

relatively positioned elements and overlaping

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>.

<#Positionable_Elements>

--
_______________________________________
REUSE CODE! Use custom tags;
See http://www.contentbox.com/claude/cus...s/tagstore.cfm
(Please send any spam to this address: pi*******@internetique.com)
Thanks.
Jul 21 '05 #1
3 1817
It would help, if you could send an URL with example. In this example
the span should overlap the p regardless of z-index.

Chris

Jul 21 '05 #2
>>In this example the span should overlap the p regardless of z-index.

But why? Both the P and the SPAN have their position set to relative, so they are
"positioned objects", so the z-index should apply.

Because the SPAN is embeded insite the P?
I cannot see this anywhere in the specs.
Jul 21 '05 #3
Claude Schneegans wrote:
In this example the span should overlap the p regardless of z-index.

But why? Both the P and the SPAN have their position set to relative, so
they are "positioned objects", so the z-index should apply.

Because the SPAN is embeded insite the P?
I cannot see this anywhere in the specs.


Claude,
If you're going to ask the question on several forums, then check each
for responses. Your question was answered yesterday at n.p.d.css .
Alexander also gave you a clue in your previous List question here.

--
Gus
Jul 21 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Philipp Lenssen | last post: by
6 posts views Thread by Claude Schneegans | last post: by
27 posts views Thread by didacticone | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.