css - SharePoint ListView JSON 格式悬停颜色

标签 css sharepoint sharepoint-list

如何更改 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/

相关文章:

c# - 使用 SharePoint 作为数据源

c#-4.0 - 使用客户端上下文和 CAML 查询删除共享点列表中的所有行

javascript - $.Deferred() 和 SharePoint 2013 JavaScript CSOM

sharepoint - 修改共享点编辑对话框

xml - 如何从 SharePoint 2010 中的数据库中找到 SharePoint 列表的字段?

css - wordpress 显示缩略图和设置样式

css - 包含 div 背景的两张图片?

html - 隐藏一个 <tr>,同时仍然将它包含在宽度计算中

php - 网站文本的随机字体?