css - (CSS) 为类设置 Id 如何使用

标签 css kendo-grid

我正在使用 Kendo Grid,我想将字体设置为白色。

当我将此 css 代码设置为 Layout 时,它会影响所有网格。但我想要的只是将白色设置为具有 id 的网格,如 #grid id no all them。

.k-grid-header th.k-header>.k-link {
    display: block;
    min-height: 18px;
    line-height: 18px;
    margin: -0.5em -0.6em -0.4em -0.6em;
    padding: .5em .6em .4em .6em;
    overflow: hidden;
    text-overflow: ellipsis;
    **color: white;**
}

如何为特定 ID 设置类?

最佳答案

在 HTML 中你有 st.喜欢<div id="yourid" class="k-grid-header">在 CSS 中:

#yourid.k-grid-header th.k-header > .k-link {...}

或者,如果 ID 在 .k-grid-header 的父级上:

<div id="yourid">
    <div class="k-grid-header">
        ...

<style>
     #yourid .k-grid-header th.k-header > .k-link {...}
</style>

关于css - (CSS) 为类设置 Id 如何使用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28804678/

相关文章:

jquery - 如何将 Kendo 分层网格与 kendoSortable 结合起来?

javascript - kendo grid如何按字段值获取行

javascript - 用于 Firefox 的带有 unicode 符号的复选框

asp.net-mvc-4 - Kendo Grid ClientTemplate 条件列

image - 在响应图像的顶部添加叠加图像

jquery - 底部 float div(如 Facebook 消息中)

c# - Kendo UI TreeListDataSource Read() 仅在本地运行时有效

javascript - KendoGrid JavaScript 运行时错误 : Invalid template

javascript - 如何使用 JS 删除或重置 CSS 样式?

android - 在 Firefox 上调试 CSS 动画性能