text-align for material ui

a.k*_*nko 5 css css3 reactjs material-ui

我无法集中我的<Paper>内心div.请帮忙

我找到<Paper><RaisedButton>在div内部并给出了css:

.timerArea {
  text-align: center;
}
Run Code Online (Sandbox Code Playgroud)

对于Button来说,它适用于纸张 - 没有.

风格 <Paper>

const timeArea = {
  height: 150,
  width: 150,
  textAlign: 'center',
  rounded: true,
  paddingTop: 65,
  backgroundColor: '#76D8E3',
  opacity: 0.8
};
Run Code Online (Sandbox Code Playgroud)

我的JSX:

<div className={styles.timerArea}>
  <Paper style={timeArea} zDepth={1} circle>{stopWatchTime}</Paper>
  <RaisedButton onClick={buttonRole} backgroundColor={buttonColor}>{buttonName}</RaisedButton>
</div>
Run Code Online (Sandbox Code Playgroud)

并在图像上得到结果 在此输入图像描述

提前致谢.

Pra*_*rma 7

像这样尝试纸张样式的自动边距

const timeArea = {
  height: 150,
  width: 150,
  textAlign: 'center',
  rounded: true,
  paddingTop: 65,
  backgroundColor: '#76D8E3',
  opacity: 0.8,
  margin: auto,
};
Run Code Online (Sandbox Code Playgroud)