在JSP中,Overlay是一种常用的技术,用于在页面上覆盖一层内容,而不影响页面的其他部分。以下是一个简单的实例,展示了如何在JSP中使用Overlay。
我们创建一个HTML页面,包含一个按钮,用于触发Overlay的显示:

```html
.overlay {
display: none;
position: fixed;
left: 0;
top: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.5);
z-index: 1000;
}
.overlay-content {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
padding: 20px;
background: white;
border-radius: 5px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}







