Home > Mobile >  css, last-child tr overwrite style
css, last-child tr overwrite style

Time:03-03

I have this styles:

.ant-table-tbody > tr > td {
  padding: 8px 0 !important;
  height: 48px;
}
.ant-table-tbody > tr:last-child > td {
  padding: 8px 0 !important;
  height: 48px;
  border-bottom: none;
}

The last definition is almost the sam except that I'm setting `border-bottom: none``

How could I write that in one single class?

I tried something like:

.ant-table-tbody > tr > td {
  padding: 8px 0 !important;
  height: 48px;
  &.tr:last-child {
    border-bottom: 1px red solid;
  }
}

but it's not working

CodePudding user response:

You need to just correct the format

.ant-table-tbody {
  > tr > td {
    height: 48px;
    padding: 8px 0 !important;
  }

  > tr:last-child > td {
    border-bottom: 1px red solid;
  }
}
  •  Tags:  
  • css
  • Related