【发布时间】:2020-02-04 21:53:45
【问题描述】:
我正在尝试将 Material-ui 中的 InputBase 元素的文本区域居中。 目前我不确定这是否是一个错误。 我如何尝试使文本区域居中的示例可以在 here 找到。
我的代码如下所示:
import {
InputBase,
makeStyles
} from "@material-ui/core";
export default function EditTitle() {
const useStyles = makeStyles(theme => ({
input: {
height: theme.typography.h1.fontSize,
fontSize: theme.typography.h1.fontSize,
fontWeight: theme.typography.h1.fontWeight,
textAlign: "center",
align: "center"
}
}));
const classes = useStyles();
return (
<InputBase
inputProps={{ "aria-label": "naked" }}
className={classes.input}
defaultValue="Title"
fullWidth={true}
textAlign="center"
align="center"
></InputBase>
);
}
但是在编译的网站上没有设置text-align: center。
当前依赖列表:
"@material-ui/core": "^4.4.3",
"@material-ui/icons": "^4.4.3",
"next": "^9.0.6",
"react": "^16.9.0",
"react-dom": "^16.9.0",
"typeface-roboto": "0.0.75"
知道我做错了什么还是这确实是一个错误?
【问题讨论】:
标签: reactjs material-ui next.js