A depth (z-index) nightmare.

Posted by JCOC611 on Stack Overflow See other posts from Stack Overflow or by JCOC611
Published on 2011-02-10T23:07:05Z Indexed on 2011/02/10 23:25 UTC
Read the original article Hit count: 208

Filed under:
|

The best way to illustrate this question is with...a Fiddle! Before you visit the fiddle, notice there is text behind the grayest element, which is on top of a light gray element that has a border.

There is a main wrapping div (root), and two wrapping divs inside (wrap1 and wrap2). The problem here is that I need the content of wrap2 (highlight) to be behind the content of wrap1 (text), but in front of the background of the root.

This, however, must not change:

  • The HTML, the elements and wraps should be left untouched. Excluding the order of wrap1 and wrap2 inside root.

  • The highlight div must keep the absolute positioning.

  • Styling highlight with background-color is not an option, the existence of highlight is a must.

PS: the italics reference the id's of <div>s in the fiddle example, for whomever was too lazy to visit it.

© Stack Overflow or respective owner

Related posts about css

Related posts about z-index