Quantcast
Channel: Active questions tagged flexbox - Stack Overflow
Viewing all articles
Browse latest Browse all 1318

Strange MUI Grid behavior when using spacing

$
0
0

I have the following code

<Box sx={{height:'100vh', background: '#f5f7fc', overflow:'auto'}}><Grid container justifyContent={'center'} padding={2}><Grid item xs={12}><Typography align="center" fontSize={30}>Welcome! Please enter your childs information</Typography></Grid><Grid item xs={10}><Paper><Grid container padding={2}><Grid item xs={6}><TextField fullWidth label='First Name'/></Grid><Grid item xs={6}><TextField fullWidth label='Last Name'/></Grid></Grid></Paper></Grid></Grid></Box>

which shows up like this, as I expectexpectedresult

Now, when I add spacing like

<Paper><Grid container padding={2} spacing={2}>

all of a sudden the Paper sticks out above Grid, and the padding on the right no longer matches the padding on the left

wrong

My question is this: what?


Viewing all articles
Browse latest Browse all 1318

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>