2017-07-30 52 views
0

我無法將我的<Paper>居中放在div中。請幫助text-align for material ui

我找到<Paper><RaisedButton>內股利和使用CSS給:

.timerArea { 
    text-align: center; 
} 

對於按鈕,它的作品,但對於紙 - 沒有。

風格<Paper>

const timeArea = { 
    height: 150, 
    width: 150, 
    textAlign: 'center', 
    rounded: true, 
    paddingTop: 65, 
    backgroundColor: '#76D8E3', 
    opacity: 0.8 
}; 

而且我的JSX:

<div className={styles.timerArea}> 
    <Paper style={timeArea} zDepth={1} circle>{stopWatchTime}</Paper> 
    <RaisedButton onClick={buttonRole} backgroundColor={buttonColor}>{buttonName}</RaisedButton> 
</div> 

,並在圖像上導致提前enter image description here

感謝。在紙風格

+0

嘗試「保證金:汽車」紙風格 –

+0

感謝,它的工作原理。 請將它寫爲答案,我將其標記爲有用 –

回答

1

嘗試緣汽車這樣

const timeArea = { 
    height: 150, 
    width: 150, 
    textAlign: 'center', 
    rounded: true, 
    paddingTop: 65, 
    backgroundColor: '#76D8E3', 
    opacity: 0.8, 
    margin: auto, 
};