Currently, I am utilizing material ui to establish a grid system for showcasing videos in 2 rows. While I have successfully set up the general layout, I am facing difficulty in eliminating the white space/padding between the elements. Despite trying nowrap as recommended in the documentation, it doesn't seem to work as expected. Below is my component code:
<Grid
container
spacing={1}
direction="row"
justify="center"
alignItems="center"
>
{media.map((media) => (
<Grid item xs={6} key={Math.random()}>
<video
className="media__object"
autoPlay
loop
src={media.mp4}
/>
</Grid>
))}
</Grid>
Below is some of the CSS for media__object:
.gif__object {
border-radius: 5px;
height: 100%;
width: 100%;
object-fit: cover;
}
Take a look at the current situation with a background color added to highlight the spacing issue.
https://i.stack.imgur.com/J9IeB.jpg
Thank you!