The z-index
property defaults to auto
, as explained in the MDN documentation.
Despite setting the z-index
to 1
using the following code:
$("body").css("z-index", 1);
Upon retrieving the value of z-index
with this code:
$("body").css("z-index");
The return value remains auto
.
Can someone explain why this is happening and suggest a way to correctly retrieve the current z-index
value?