Reputation: 25
I tried to add a text between the two textfield but somehow the text is not properly aligned with the two textfield
import React from 'react';
import { makeStyles } from '@material-ui/core/styles';
import TextField from '@material-ui/core/TextField';
import Typography from '@material-ui/core/Typography';
const useStyles = makeStyles((theme) => ({
root: {
'& > *': {
margin: theme.spacing(1),
width: '12ch',
},
display:"row"
},
}));
export default function BasicTextFields() {
const classes = useStyles();
return (
<form className={classes.root} noValidate autoComplete="off">
<TextField id="standard-basic" label="Standard" />
<font size="6">feet</font>
<TextField id="outlined-basic" label="Outlined" variant="outlined" />
<font size="">inches</font>
</form>
);
}
Reference: https://codesandbox.io/s/m43tj?file=/demo.js:0-719
Upvotes: 0
Views: 209
Reputation: 512
In this root class, which is your form's container, add the following style:
display: 'flex',
alignItems: 'center',
Hope this helped =)
Upvotes: 1