Automatically determine the 'z-index' offset from CSS