gpt4 book ai didi

javascript - 在 mui 的文本字段上对齐文本中心

转载 作者:行者123 更新时间:2023-11-30 14:19:53 24 4
gpt4 key购买 nike

这是我想要的:

enter image description here

这是我的结果:

enter image description here

我尝试将样式分配给我的输入 Prop ,但没有成功,有什么想法吗?谢谢。

<TextField
key={'verifyKey_'+i}
multiline={false}
InputProps={{
textAlign: 'center',
disableUnderline: true,
style: {
color: 'red',
textAlign: 'center'
}
}}
style={{
height: '50px',
width: '50px',
textAlign: 'center',
justifyContent: 'center'}}/>

最佳答案

使用 flexbox 并将 textAlign: 'center' 替换为 alignItems: 'center':

{
height: '50px',
width: '50px',
display: 'flex',
alignItems: 'center',
justifyContent: 'center'
}

关于javascript - 在 mui 的文本字段上对齐文本中心,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52944369/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com