How to Remove Gray Space Below Images in Microsoft Lists Gallery View
Question details
The user needs to eliminate the unwanted gray space appearing beneath images in Microsoft Lists gallery view cards.

- Product
- Microsoft Lists
- Device & OS
- not provided
- Scenario
- Customizing the layout of a gallery card using SharePoint JSON formatting.
- Observed behavior
- A gallery card renders an unexpected gray gap between the image and the subsequent text fields, which is not easily resolved with standard style changes.
Ensure you have the necessary permissions to edit the view formatting in Microsoft Lists, and copy your original JSON code into a text editor as a backup before making any changes.
Adjust JSON Formatting for Image Containers
Modify the view formatting JSON to remove fixed heights or unused flexbox spacing that is causing the gray gap.
The gray space usually appears when standard JSON style parameters like height, width, padding, or margins are improperly applied to the image's parent container, leaving unused space in the flexbox layout.
Navigate to your Microsoft List, click on the current View dropdown menu in the upper right corner, and select 'Format current view'.
At the bottom of the format pane, click on 'Advanced mode' to reveal the raw JSON code for your gallery cards.
Locate the 'div' element wrapping your image. Look for any 'height', 'aspect-ratio', or 'padding' properties applied to this container.
Remove unnecessary fixed height values from the container and adjust the image dimensions. Ensure flexbox properties like 'justify-content' or 'align-items' are not forcing the elements to stretch.
Click the 'Preview' button to verify that the gray space below the image has been removed. Once satisfied with the layout, click 'Save'.

Consult Microsoft Q&A Forum
If manual JSON adjustments do not resolve the layout issue, seek expert assistance from SharePoint developers.
Manage Data without Complex Formatting using WPS Office
While customizing Microsoft Lists often requires complex JSON formatting just to fix basic image layouts, WPS Spreadsheet provides an intuitive, lightweight, and completely free alternative. Easily manage your lists, align images perfectly in cells without coding, and enjoy seamless compatibility with Microsoft Excel formats.
- 1. Download WPS Office: Visit the official WPS website to download the free office suite for your device.
- 2. Install the Application: Run the installer and follow the quick setup instructions to install WPS Spreadsheet.
- 3. Import Your Data: Open WPS Spreadsheet and directly import your existing Excel files or CSV lists to start managing data effortlessly.

Frequently Asked Questions
Why does my Microsoft Lists gallery card have extra space below the image?
Extra space typically appears when the JSON formatting assigns a fixed height or incorrect aspect ratio to the image container. This causes the flexbox layout to fill the remaining area with empty gray space.
Can I use standard CSS properties in Microsoft Lists JSON formatting?
Yes, Microsoft Lists view formatting supports a subset of standard CSS properties under the 'style' attribute. You can use properties like margin, padding, flex, object-fit, and height to control your card layout.
How do I access the advanced JSON editor in Microsoft Lists?
Click on the current view dropdown menu at the top right of your list, select 'Format current view', and then click 'Advanced mode' at the bottom of the formatting pane. This allows you to edit the raw JSON directly.




