【发布时间】:2019-10-01 21:06:00
【问题描述】:
我给父 div 不透明度,但它也影响子 div。我只想给父 div 不透明度
我创建了单独的 div
<div id="container" style={{backgroundImage:"url('/images/world-map-dotted.png')",padding:'100px',height:'1000px',width:'100%',textAlign: 'center',opacity:'0.9'}}>
<div id="box" style={{height:'100%',width:'100%'}}>
<div style={{backgroundImage:"url('/images/bg_login.png')",padding:'300px'}}>
<h1 style={{fontSize: '40px'}}>We’ll be back soon!</h1>
<p style={{fontSize:'18px'}}><b>Sorry for the inconvenience but we’re performing some maintenance at the moment.
<p style={{fontSize:'18px'}}><b>For any queries, please contact <a></a></b></p></b>
</p>
</div>
</div>
</div>
我希望只有父 div 中的图像会改变其不透明度
【问题讨论】:
-
您应该在
#container上使用::after选择器,并添加不透明度。