Changing the background color in the gallery view of a SharePoint list

BIユーザー 80 Reputation points
2024-03-01T06:06:37.46+00:00

When you view a SharePoint list in Gallery View, each card has a white background. Can I customize the background color to any color?image (17).png

Microsoft 365 and Office SharePoint For business Windows
0 comments No comments
{count} votes

Accepted answer
  1. Xyza Xue_MSFT 30,176 Reputation points Microsoft External Staff
    2024-03-01T07:47:47.9733333+00:00

    Hi @BIユーザー ,

    Thank you for posting in this community.

    Yes, you can customize the background color in the gallery view of a SharePoint list to any color.

    Here are steps:

    1. Open the Gallery view in Microsoft Lists
    2. Select on the name of the view displayed on the command bar > Select Format curret view
    3. Select Edit card
    4. Sort and show/hide content
    5. Select Advance mode steps to open advance mode
    6. Add the following code to the div containing the sp-card-subContainer class (between lines 24,25,26)
       "style": {
         "background-color": "*** HTML color code or name ***"
       },
       
    

    User's image

    Reference:https://pnp.github.io/blog/post/how-to-change-the-background-color-of-cards-in-the-gallery-view/

    Note: Microsoft is providing this information as a convenience to you. The sites are not controlled by Microsoft. Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. Please make sure that you completely understand the risk before retrieving any suggestions from the above link.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.