我有一个需求,我需要在单个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谢谢你的回复。但它不工作:( –