我有一個需求,我需要在單個td單元格中顯示兩個glyphicons。但第二個是第一次壓倒一切。在單個td單元格中顯示兩個glyphicons
在下面的代碼:
我派兩種風格,其包含的代碼gyphicons:
table.setHeaderStyles("weekdays", i - daysBefore, " dayinfo glyphicon glyphicon-info-sign" + glyphicon-exclamation-sign);
這裏是如何顯示爲HTML
<td class="v-table-cell-content v-table-cell-content- dayinfo glyphicon glyphicon-exclamation-sign" style="width: 26px;"><div class="v-table-cell-wrapper" style="text-align: center; width: 26px;">Fri</div></td>
這裏是CSS適用款式:
.glyphicon-exclamation-sign:before {
font-family: "Glyphicons Halflings" !important;
font-size: 10px !important;
color: #991F3D !important;
margin-bottom: -7px !important;
float: right;
}
.glyphicon-info-sign:before {
font-family: "Glyphicons Halflings" !important;
font-size: 9px !important;
color: #1F6689 !important;
margin-bottom: -7px !important;
float: left;
}
這裏的第二種風格是覆蓋第一種風格。 但我希望這兩種風格都能顯示出來。
有沒有辦法做到這一點?請幫幫我。謝謝。
嘗試使用':的after'代替':before'對於第二選擇器。 –
@Koen謝謝你的回覆。但它不工作:( –