【发布时间】:2017-11-04 13:18:24
【问题描述】:
我有下一个代码:
<button onClick={this.openModal}>[{this.props.defaultValue}]</button>
从
获取的文本[{this.props.defaultValue}]
始终居中。有没有办法让它向左对齐?
这是我目前正在尝试的:
const bstyle = {
textAlign:'left',
color: 'white'
};
const {open} = this.state;
return (
<div>
<button style={bstyle} onClick={this.onOpenModal}>[{this.props.defaultValue}]</button>
....
没有结果。 :-( 我可以看到按钮向左对齐。但它的文字要居中。
【问题讨论】:
标签: css reactjs ecmascript-6