【问题标题】:How to center a button in material ui?如何在材质ui中居中按钮?
【发布时间】:2020-10-18 21:14:42
【问题描述】:

下面给出的是我使用材料 ui 编码的代码。我对那个区域还是新手。我需要将我的按钮居中。但它到了角落。我的代码有什么问题吗?

 
``` 按钮:{ 背景:'线性渐变(45度,#FE6B8B 30%,#FF8E53 90%)', 边界半径:8, 边界:0, 白颜色', 身高:48, 宽度:“30%”, 填充:'10px 30px', boxShadow: '0 3px 5px 2px rgba(255, 105, 135, .3)', justifyContent: '中心' } alignItems="center" 对我不起作用。

标签: material-ui


【解决方案1】:

论文:{

textAlign: 'center',
color: theme.palette.text.secondary,

},

我启用了 textAlign: 'center' 并且它已修复

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-02-06
    • 1970-01-01
    • 2019-10-13
    • 1970-01-01
    • 1970-01-01
    • 2021-07-23
    相关资源
    最近更新 更多