(css) Native html realizes the mask layer pop-up window

(css) Native html realizes the mask layer pop-up window


Effect:

insert image description here


html

<div class="overlay">
	<div class="content">
		 <!-- 需要遮罩的内容 --> 
		 <el-table :data="tableData" size="mini" class="table-class" border stripe>
		   <el-table-column type="index" label="序号" width="50" align="center" /></el-table-column>
		   ...
		 </el-table>
	</div>
</div>

css style:

.overlay {
    
    
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5); /* 设置背景颜色为半透明黑色 */
  z-index: 9999; /* 设置 z-index 值确保遮罩层位于其他元素之上 */
  display: flex;
  justify-content: center;
}

.content {
    
    
  position: relative;
  z-index: 10000; /* 设置 z-index 值确保内容层位于遮罩层之上 */
  background-color: #01bdb2;
  width: 50%;
  height: 30%;
  margin-top: 10%;
}

Guess you like

Origin blog.csdn.net/qq_44754635/article/details/131850224