目标: 我希望表单中的标题、选项卡部分和单选按钮部分固定(见下图)。也就是说,它们应该始终可见,不会有任何重叠的元素。
表单如下所示:
这在我简单地向下滚动表单时运作良好:问题:
当我打开Angular Material下拉菜单时,它会覆盖收音机按钮区域:
这是HTML代码。我希望在表单中固定突出显示的部分是以下元素:
这是三个部分的CSS代码
//Header:
.module__header {
position: fixed;
top: 0px;
z-index: 1001;
display: flex;
height: 35px;
width: 100%;
background-color: #082749;
color: #FFFFFF;
font-size: 14px;
font-weight: 500;
align-items: center;
justify-content: stretch;
padding: 0;
margin-bottom: 0;
}
// Tab Section:
.mat-tab-label-container {
position: fixed;
top: 35px;
padding-top: 10px;
z-index: 1001;
width: 100%;
background: #fff;
}
// Radio Button Section:
.timaticFullTextView {
padding-top: 35px;
padding-left: 15px;
padding-bottom: 15px;
background: #fff;
z-index: 1001;
position: fixed;
width: 100%;
border-bottom: 1.5px solid gray;
}
我已经尝试将cdk-overlay-container更改为z-index<1001,但仍然会遮挡单选按钮部分。如何使打开的下拉菜单显示在所有3个部分之下?备注:添加截图以显示引起问题的cdk-overlay。我已尝试删除和降低z-index,但没有任何效果。
![enter image description here](https://istack.dev59.com/kcgYO.webp)
z-index: -1
或更低的值。 - Ismail Vittalz-index
值也增加。 - Ismail Vittal