I'm struggling to align two <TextArea>
components using material ui and React.
Both of them are contained within the same <div>
and share the same className. Despite trying to apply the !important
rule in CSS, I haven't been able to center the MUI elements properly. Interestingly, a standard <input>
behaves as expected when styled with the same CSS properties. How can I achieve proper alignment for the <TextField>
components?
JSX
<Container maxWidth="md">
<TextField
id="outlined-read-only-input"
label="Username"
/>
<TextField
id="outlined-read-only-input"
label="Password"
/>
</Container>
CSS
.login__input {
display: block !important;
margin-left: auto !important;
margin-right: auto !important;
margin-bottom: 20px !important;
width: 300px !important;
}
[1]: https://i.sstatic.net/qu0xa.png