Pictures in Gallery view (Sharepoint modern pages)

OS at SaT 0 Reputation points
2023-03-09T04:59:26.7133333+00:00

Many thanks for your efforts already in advance.

Problem setting on sharepoint modern pages:

a) List with a picture column --> works

b) Added picture as *.svg --> works

b) Display list in Default Gallery view --> works

c) Picture is displayed on the card too big and therefore, only partly visible. How and where do I resize the picture to be displayed optimally on the gallery card? --> my question

Many thanks!

OS

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

1 answer

Sort by: Most helpful
  1. Emily Du-MSFT 51,861 Reputation points Microsoft External Staff
    2023-03-09T09:32:09.43+00:00

    Please try following JSON codes to stretch image.

    {  
      "elmType": "div",  
      "__comment": "Div 1",  
      "style": {  
        "flex-grow": "1",  
        "display": "flex",  
        "flex-direction": "column",  
        "flex-wrap": "nowrap",  
        "align-items": "stretch",  
        "max-width": "260px"  
      },  
      "children": [  
        {  
          "elmType": "img",  
          "style": {  
            "width": "260px",  
            "height": "160px"  
          },  
          "attributes": {  
            "src": "[$Picture]"  
          }  
        }  
      ]  
    }  
    

    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.


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.