See this fiddle.
Why is the newly added blue div showing over the paragraph? Isn't :before
supposed to place it behind the p
?
See this fiddle.
Why is the newly added blue div showing over the paragraph? Isn't :before
supposed to place it behind the p
?
There appears to be no documentation commenting on the z-dimensional position of :before
and :after
. And, as @BoltClock points out, they should behave just like normal elements (non-pseudo-elements) in terms of stacking.
Try using z-index: -1;
on your :before
segment if you want it behind the paragraph itself. (Basic fiddle: http://jsfiddle.net/fDvTk/; applied fiddle: http://jsfiddle.net/XvYng/)
Code:
#example1 p:before{
/* ... */
z-index: -1;
}