【发布时间】:2018-10-02 09:43:48
【问题描述】:
没有找到如何在 reactjs 中设置背景图像覆盖不透明度的方法,我正在尝试做类似的事情。
风格
const styles={
header:{
background: 'rgba(0, 0, 0, 0.5)',
backgroundImage:url(${background}),
height: '100vh',
backgroundPosition:'center',
backgroundRepeat: 'no-repeat',
backgroundSize: 'cover'
}
}
JSX
<div style={styles.header}>
<div>
Portfolio
</div>
</div>
【问题讨论】:
标签: reactjs css stylesheet