Recently, I've been working on a frontend project using Material UI. In my design, I have cards that display data, and I wanted to include an avatar in the center of each card. Despite using a card header to insert the avatar, I struggled to align it properly. I attempted setting alignContent and textAlign to center within the media style class, but unfortunately, it didn't do the trick.
Any suggestions on how I can achieve this desired center alignment? Should I consider utilizing something other than the cardHeader?
<CardHeader
className={classes.media}
avatar={<Avatar alt="Alias" src={alias1} className={classes.small} />}
/>
Update: Ultimately, I was able to center the avatar by specifying marginLeft and marginRight as 'auto' within the "small" class. However, the accepted solution also proved effective.