Making simple React application with inputs. I do not understand why inputs, button and icon in flex container do not get margins nor they can not be justified evenly. I am using Material UI textfield and button components.
My code is like this:
<div className="InputContainer">
<form onSubmit={(event) => handleAddPerson(event)}>
<TextField
className="input"
id="name"
required
label="Name"
variant="filled"
value={name}
onChange={handleNameChange} />
<TextField
className="input"
id="email"
required
label="E-mail address"
variant="filled"
value={email}
onChange={handleEmailChange} />
<TextField
className="input"
id="phone"
required
label="Phone number"
variant="filled"
value={phone}
onChange={handlePhoneChange} />
<Button
className="addButton"
variant="outlined"
type="submit"
>Add
</Button>
<CustomizedTooltip className="tooltip" title={tooltipText}>
<IconButton><HelpOutlineIcon /></IconButton>
</CustomizedTooltip>
</form>
</div>
CSS is here:
.InputContainer {
background-color: white;
min-height: 72px;
padding: 16px;
margin-bottom: 16px;
width: 878px;
display: flex;
align-items: center;
justify-content: space-evenly;
}
.input {
display: inline-flex;
min-height: 40px;
/* margin-left: 20px; */
background-color: #fafafa;
}
.addButton {
display: inline-flex;
height: 38px;
margin-top: 16px;
}
I have tried things mentioned here: Columns of text not aligning evenly in flex container and here: Better way to set distance between flexbox items. No luck. Should be easy to implement, I don't understand what I'm doing wrong.
Here is what I am getting with this code: no space in between inputs and a button.