https://getbootstrap.com/docs/5.1/content/tables/#overview
如何覆寫和修改table標題下方的引導程式 5邊框?
我想通過簡單的 CSS 覆寫來實作這一點,而不是使用 SASS。
我嘗試了以下方法,但沒有任何效果:
.table > thead > tr > th {
border-bottom-color: red !important;
}
uj5u.com熱心網友回復:
稍微嘗試了一下,出于某種原因,我只能通過指定整個border-bottom屬性來覆寫現有樣式,包括寬度、樣式和顏色,寬度最小為2px. 我還能夠簡化選擇器,并洗掉!important.
.table thead th {
border-bottom: 2px solid red;
}
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" integrity="sha384-uWxY/CJNBR 1zjPWmfnSnVxwRheevXITnMqoEIeG1LJrdI0GlVs/9cVSyPYXdcSF" crossorigin="anonymous">
<table class="table">
<thead>
<tr>
<th>#</th>
<th>First</th>
<th>Last</th>
<th>Handle</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>Heretic</td>
<td>Monkey</td>
<td>Heretic Monkey</td>
</tr>
</tbody>
</table>
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/320821.html
上一篇:在網頁設計中將頁面分成一個部分
