![](/img/trans.png)
[英]custom styling of specific component getting applied to all the components in angular 6
[英]Custom Styling not getting applied to the kendo grid in Angular 6
嗨,我正在嘗試向kendo網格中的選定行添加自定義樣式,但未得到應用。
以下是我在該組件的css文件中的代碼
:host ::ng-deep .modal-dialog .k-grid td.k-state-selected, .k-grid tr.k-state-
selected>td {
background-color:lightgreen;
}
我聯系了telerik支持人員,他們要求我在ts文件中添加encapsulation:ViewEncapsulation.None,但是在添加該樣式后,該樣式將應用於所有組件,因此我無法找到為什么未應用該樣式的原因。
在關於stackoverflow的問題之一中,我發現:host :: ng-deep通過添加它可以正常工作,因此我嘗試了但仍無法正常工作。
我的Kendo-Grid在Bootstrap Modal Popup上。
它通過以下更改為我工作
:host ::ng-deep .modal-dialog .k-grid td.k-state-selected,:host ::ng-deep .k-grid tr.k-
state-selected>td {
background-color:lightgreen;
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.