我有带有两行标题的粘性桌头。背景的颜色thead必须是白色,这样我可以保持粘性行为,但背景覆盖了行的边框。
如何使边框出现在背景上?
.table-responsive {
height: 500px;
}
thead {
position: sticky;
top: 0px;
background: white;
/* removing background color allow border to appear (though not perfectly) but then the sticky behavior doesn't quite work */
z-index: 3;
}
.sticky-col-top {
position: sticky;
left: 0px;
top: 0px;
max-width: 6em;
min-width: 6em;
background: white;
background-clip: padding-box;
z-index: 3;
}
.weekday-row {
border-top: 3px solid #E2E2E2;
}
.sticky-col {
position: sticky;
left: 0px;
width: 6em;
background: white;
background-clip: padding-box;
border-bottom: 1px solid #E2E2E2;
font-weight: normal;
font-size: 14px;
z-index: 2;
}
td:nth-child(even),
th:not(.days):nth-child(even) {
background: #F7F7F7;
}
.days {
color: #606060;
}
js小提琴:https://jsfiddle.net/base_kh/t59xrjw6/13/
守着一只汪
UYOU
相关分类