How can I place title center on CardHeader (Material-UI)?
I am using Material-UI v0.18.7
Here is my code. I tried with textAlign: 'center' to titleStyle prop but that doesn't work.
const myTheme = {
cardHeaderStylePref:{
background: 'linear-gradient(to right bottom, #430089, #82ffa1)',
color: config.actualWhite,
height: 30,
padding: 0
}
}
<Card>
<CardHeader
title={this.props.prefName}
style={myTheme.cardHeaderStylePref}
subtitleColor={myTheme.color}
titleColor={myTheme.color}
titleStyle={{textAlign: 'center'}}
>
</CardHeader>
<CardText>
Sample text
</CardText>
</Card>
display: blockto the element's parent. - ishahadathbCardHeaderhas any float applied to it. if it's floated, remove or overwrite the float.As I can't see the styles being applied to the both of the elements it's hard to determine exactly what's wrong. - ishahadathb