如何在材质ui中将按钮居中?

时间:2020-06-28 17:07:11

标签: material-ui

下面给出的是我使用材质ui编写的代码。我仍然是该领域的新手。我需要将按钮居中。但是现在到了角落。我的代码有问题吗?

                <Button className={clsx(classes.button)} 
                type="submit"
                alignItems="center"
                variant="contained">
                 {'Sign Up'}
                </Button>
                </div>```



button:{
    background: 'linear-gradient(45deg, #FE6B8B 30%, #FF8E53 90%)',
    borderRadius: 8,
    border: 0,
    color: 'white',
    height: 48,
    width: "30%",
    padding: '10px 30px',
    boxShadow: '0 3px 5px 2px rgba(255, 105, 135, .3)',
    justifyContent: 'center'
  }

alignItems="center" does not work for me.

1 个答案:

答案 0 :(得分:0)

论文:{

{% endblock %}

},

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