我想添加一個不透明的襯底使用CSS。如何用CSS創建不透明底層?
你能幫我理解我做錯了什麼嗎?
CSS
popUp#translucent{
width: 400px;
height: 100px;
background-color: black;
margin-left: auto;
margin-right: auto;
position:fixed;
opacity: .4;
}
popUp#content{
width:400px;
height: 100px;
}
#popContainer{
width: 400px;
height: 100px;
display: visible;
position: fixed;
z-index: 1000;
}
HTML
<div id="popContainer">
<popUp id="translucent"></popUp>
<popUp id = "content">
<button class="btn large btn-custom" data-h="193" data-s="32" data-l="64" ,="" data-p="15">Alpha</button>
</popUp>
</div>
感謝
從有效標記開始; 'popUp'不是一個HTML元素,看起來你只是做了它。另外:',=「」'...什麼? –
@wesleyMurch我試圖按照http://iwearshorts.com/blog/annoying-css-opacity-inherited-by-children/ – user1530249