[英]Angular PrimeNG listbox cross label
My advice would be to try and inspect the element you are trying to modify using the browser's DevTools (play in the Style section until you reach the desired result) and then change it in your code. 我的建议是尝试使用浏览器的DevTools检查要修改的元素(在“样式”部分中播放,直到获得所需的结果),然后在代码中进行更改。
As for the question, you want to remove the background for the selected state of the list item and then give the line-through text-decoration property. 对于问题,您要删除列表项所选状态的背景,然后提供直通文本装饰属性。 This should be the CSS part to solve your issue with the right selectors:
这应该是CSS部分,以使用正确的选择器解决您的问题:
body .ui-listbox .ui-listbox-list .ui-listbox-item.ui-state-highlight {
color: #000000;
text-decoration: line-through;
background-color: none;
}
Please note that the text color is changed to be visible after we remove the blue background. 请注意,移除蓝色背景后,文字颜色将更改为可见。 This is only for the highlighted state of a list box item ( .ui-listbox-item.ui-state-highlight ).
这仅适用于列表框项目的突出显示状态( .ui-listbox-item.ui-state-highlight )。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.