尝试覆盖KendoUI网格中标题的默认对齐方式。CSS选择器 - 特异性问题
标准选择器看起来像这样;
.k-grid-header th.k-header, .k-filter-row th {
overflow: hidden;
border-style: solid;
border-width: 0 0 1px 1px;
padding: .5em .6em .4em .6em;
font-weight: normal;
white-space: nowrap;
text-overflow: ellipsis;
/* text-align: left; */
}
我已经添加了一个自定义类(“gridheaderalign”)的标题单元格像这样;
<th role="columnheader" data-field="DELIVERED_QUANTITY" rowspan="1" data-title="Del. Qty" data-index="5" id="3ed03852-7178-4513-9648-06a3e42bf69a" class="gridheaderalign k-header ng-scope" data-role="columnsorter"><a class="k-link" href="#">Del. Qty</a></th>
尝试写CSS选择器,所以我可以覆盖默认的文本对齐方式,尝试了很多不同的排列组合,但不工作!
E.g.
.gridheaderalign.k-header
{
text-align: center;
}
.gridheaderalign
{
text-align: center;
}
确定这是一个特异性问题,但不知道如何得到正确的选择器。
非常感谢Bhojendra - 这对我很有用。 – OEDev