【问题标题】:border not have round limits - css边框没有圆形限制 - css
【发布时间】:2022-01-13 03:13:16
【问题描述】:

如何将底部边框固定为圆形限制? 我所需要的只是将实线四舍五入,并且在我的表格编码时,该线未四舍五入

 <p-table [value]="fg?.controls?.treesSummary?.controls" styleClass="sumTable">
        <ng-template pTemplate="header">
          <tr>
          </tr>
          <tr *ngFor="let item of  fg?.controls?.treesSummary?.controls; let i = index" [formGroupName]="i" class="gray-border">
            <th class="th_first_t">
              <input type="number" [attr.disabled]="true" #ddNames [value]="this?.fg?.get('treesSummary')?.controls[0]?.get('copying')?.value +
              this?.fg?.get('treesSummary')?.controls[0]?.get('unproot')?.value +
              this?.fg?.get('treesSummary')?.controls[0]?.get('conservation')?.value"
              digitOnlyTextBox pInputText />
            </th>
            <th class="th"><input type="number" #ddNames digitOnlyTextBox formControlName="conservation" pInputText /></th>
            <th class="th"><input type="number" #ddNames digitOnlyTextBox formControlName="copying" pInputText /></th>
            <th class="th_last_t"><input type="number" #ddNames digitOnlyTextBox formControlName="unproot" pInputText /></th>

          </tr>
        </ng-template>

      </p-table>

css

.gray-border {
  border-left: 1px solid gray;
  border-right: 1px solid gray;
  border-bottom: 1px solid gray;
}
.th_last_t {
    border-radius: 0px 0 0 15px !important;
    background-color: red !important;
}
.th_first_t {
  border-radius: 0 0px 15px 0 !important;
  background-color: #edf3fb !important;
}

圆角弯曲

【问题讨论】:

  • 该行来自父元素,也将其四舍五入
  • @MANSOORKOCHY 谢谢,但它不会改变它
  • 边界线从何而来?我的意思是哪个元素?

标签: css angular sass primeng


【解决方案1】:

如果我正确理解了这个问题,我认为您还需要将边框半径添加到 .gray-border :

.gray-border {
  ...
  border-radius: 0 0 15px 15px;
}

我注意到您还需要将 th_first_t 和 th_last_t 的边界半径交换为如下所示:

.th_last_t {
    ...
    border-radius: 0 0px 15px 0 !important;
}
.th_first_t {
    ...
    border-radius: 0px 0 0 15px !important;
}

这是一个 jsfiddle: https://jsfiddle.net/ds0uph3v/

【讨论】:

  • 谢谢,但不会改变
  • @Kate - 请查看更新的答案
  • 谢谢!我的问题是显示:flex。当我添加它时,它会使边框变圆,但它将所有输入移动到 th
  • 我在我的问题中添加了图片,谢谢
  • 你可能不需要 display flex 来做你正在做的事情,那只是为了让我可以轻松地连续获得所有 div。
猜你喜欢
  • 1970-01-01
  • 2016-05-07
  • 2018-02-12
  • 2021-03-10
  • 2020-08-10
  • 2016-05-24
  • 1970-01-01
  • 1970-01-01
  • 2015-10-17
相关资源
最近更新 更多