用Material-UI在我的日志表单中尝试居中一个徽标,除了卡的左侧的徽标之外,其他所有东西似乎都居中。
我尝试在img标签下添加align="center"和justify="center",但它仍然没有移动卡片中心的图像。我还尝试在const样式下添加一个"gridItem“alignItems:'center'
const styles = theme => ({
logo: {
padding: "1rem",
width: 300,
[theme.breakpoints.down("sm")]: {
width: 200,
}
},
appName: {
color: '#2979ff',
[theme.breakpoints.down("sm")]: {
fontSize: theme.typography.h5.fontSize
}
},
});<Grid container justify="center" alignItems="center">
<Grid item>
<Card>
<Grid item>
<img className={classes.logo} alt="Portal Logo" src={Logo} align="center" />
</Grid>我希望徽标在我的“登录”表单,我已经创建了中心。
发布于 2019-11-08 08:06:36
尝试将text-align:center作为logo的父元素
HTML
<div class="logo">
<img src="logo.png">
</div> CSS
.logo{
text-align:center;
}https://stackoverflow.com/questions/58758247
复制相似问题