如何更改 SharePoint ListView 中超链接的悬停颜色?
我的 ListView 的 JSON 如下。
谢谢!
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/view-formatting.schema.json",
"hideSelection": true,
"hideColumnHeader": true,
"rowFormatter": {
"elmType": "a",
"txtContent": "@currentField",
"attributes": {
"class": "sp-field-fontSize14",
"href": "[$Link]"
},
"style": {
"color": "#8F7034",
"text-decoration": "none",
"width": "300px",
"min-width": "200px",
"min-height":"1em",
"height":"1em",
"white-space": "nowrap",
"padding-left": "=if(indexOf(@currentField, ' ') == 1, '', if(indexOf(@currentField, ' ') == 3, '20px', '40px'))"
}
}
}
最佳答案
使用 ms-bgColor-<color>--hover
更改悬停颜色。
例如:
attributes": {
"class": "sp-field-fontSize14 ms-bgColor-red--hover",
"href": "[$Link]"
},
关于css - SharePoint ListView JSON 格式悬停颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59072156/