Reputation: 20222
I have the following JSX code:
<div style={Object.assign({}, styles.occupyAllScreen, styles.backgroundContainer)}>
<div styles={styles.overimposingText}>
<h2 styles={{color: 'white !important'}}>
Hi everyone!
</h2>
</div>
</div>
Where the styles used are these:
const styles = {
occupyAllScreen: {
width: '100%',
height: '100%'
},
backgroundContainer: {
position: 'relative',
backgroundColor: 'black',
textAlign: 'center'
},
overimposingText: {
position: 'absolute',
color: 'white !important'
}
};
As it can be seen, I specified color: 'white !important'
both in the h2
containning the text and the enclosing div
.
However, the component still looks like this:
Any idea why the text can not be made white?
I made a fiddle for it here.
Upvotes: 0
Views: 44
Reputation: 7187
correct syntax
<h2 style={{color: 'white'}}>
Hi everyone!
</h2>
Upvotes: 1