Given below is the code which I coded using material ui.I'm still new to that area.I need to center my button.But it comes to the corner.Is there any problem in my code?
<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.
align-items
property sets thealign-self
value on all direct children. In other words, if you have a flexbox container around your button, this is where the property needs to be applied. This is not MUI-specific behavior. Btw, you can removeclsx
if you only apply one class. – hotpink