views:

39

answers:

1

Hello,

Is z-index only used when you set an element's position to absolute or it can also be used with an element having position set to relative?

Thanks

+1  A: 

Following the W3C specification:

z-index only works on positioned elements (position:absolute, position:relative, or position:fixed).

source: http://www.w3schools.com/css/pr_pos_z-index.asp

Dor