【发布时间】:2019-12-14 02:11:14
【问题描述】:
我尝试使用 ::after 将 box-shadow 添加到表中的行,因为在 Internet Explorer 中,表中的 box-shadow 存在许多错误,所以这是我在阴影显示正常时的一种解决方案。我有行中的数据,它必须是可点击的,并且应该可以选择文本。
SCSS:
.table {
width: 100%;
border-collapse: separate;
border-spacing: 0 3px;
padding: 0 2px;
border-radius: 30px;
&-row {
position: relative;
transition: all 0.2s ease;
border: 1px solid $c-white;
border-radius: 3px;
background-color: $c-white;
box-shadow: 0 1px 7px 10px red;
&::after {
content: '';
position: absolute;
display: block;
border-radius: 3px;
width: 100%;
height: 48px;
box-shadow: 0 1px 7px 0 rgba(0, 0, 0, 0.12);
left: 0;
}
}
}
HTML:
<table mat-table [dataSource]="source">
<ng-container matColumnDef="select">
<th mat-header-cell *matHeaderCellDef class="table-header-cell"></th>
<td mat-cell *matCellDef="let row" class="table-cell button"></td>
</ng-container>
</table>
我尝试了z-index:,但没有结果。
有什么方法可以让我的行可点击,以便我可以从中选择文本??
【问题讨论】:
-
只为前后添加宽度和高度。请提供有价值的代码
-
你能再描述一下吗?
-
你能把对应的html发布到你的css吗?目前您的 HTML 中没有
table-row。 -
正如您在
<td>中看到的那样,*matCellDef=let row中有,所以我认为这是table-row。
标签: html css angular pseudo-class