Css MaterialUI如何将输入中的文本向右或居中对齐?
如何对齐物料UI输入文本的文本?下面的方法似乎不起作用。我使用的是1.x版Css MaterialUI如何将输入中的文本向右或居中对齐?,css,reactjs,material-ui,Css,Reactjs,Material Ui,如何对齐物料UI输入文本的文本?下面的方法似乎不起作用。我使用的是1.x版 import {Input} from 'material-ui'; //didn't work <Input className="max-w-128 inline-block" style = {{textAlign: 'center'}} id="input-quantity" inputStyle={{ textAlign: 'center' }} //tried hintS
import {Input} from 'material-ui';
//didn't work
<Input
className="max-w-128 inline-block"
style = {{textAlign: 'center'}}
id="input-quantity"
inputStyle={{ textAlign: 'center' }}
//tried hintStyle as suggested in a bug
hintStyle={{ width: '600px', textAlign: 'center' }}
value={this.state.currentRecord.quantity}
onChange={this.handleCurrentRecordTextChange('quantity')}
/>
从“物料界面”导入{Input};
//没用
您只需使用(覆盖样式):
风格应该是:
const styles = theme => ({
inputCenter: {
textAlign: "center",
color: "red"
}
});
从这里查看文档:
以下是一个工作示例:
希望这对您有所帮助。请使用
<Typography align="centre|right" />
如果您已经设置了特定的字体,那么将上述解决方案与Style HOC一起使用是否可行?找不到与此相关的任何资料。谢谢!帮了我大忙,非常感谢你指出了这一点。我修复了依赖性问题。请查收。
<Typography align="centre|right" />