Div 显示为模态

Div showing like a Modal

有没有办法像模式一样在同一个阴影处显示 div?

我有模态框。当模式出现时,我还想在左角显示一个包含消息的 DIV 。 这个 DIV 应该出现在模式的前面,但它没有。

我尝试了以下方法但没有成功。

.div{
  z-index:9999;
  position:absolute;
}

注意 我正在使用 lightbox 渲染包含图像的模式。

Z-index 和位置应该可以,试试这个。

.div{
  z-index: 9999;
  position: absolute;
  background-color: white; /* just to see if the div is there */
  left: 0;
  top: 0;
}