我創建了一個小的燈箱腳本,腳本本身工作正常,但問題是填滿整個屏幕的lightbox
類需要半透明,如果我做到這一點,lightbox-image
變得半透明以及。我嘗試將opacity: 1;
添加到lightbox-image
,但它不起作用。你能幫我嗎?從兒童類中刪除不透明度類
的HTML看起來像這樣:
<div class="lightbox">
<div class="lightbox-image">
<p>Something here</p>
</div>
</div>
CSS:
.lightbox {
display: none;
position: absolute;
width: 100%;
top: 0;
left: 0;
height: 100%;
background-color: #000;
z-index: 1000;
opacity: 0.9;
filter: alpha(opacity=90);
}
.lightbox-image {
position: fixed;
display: none;
width: 600px;
text-align: center;
z-index: 1001;
background-color: #000;
margin-top: 100px;
margin-left: auto;
margin-right: auto;
}
'background-color:transparent repeated 1px image;'? –
我試過使用IE過濾器,但我現在在IE8和7 –
沒有完全透明的背景,因爲後備你可以使用**圖像** 1px乘以1px :)像'background:url(path/to/image)repeat; '背景之前:rgba(0,0,0,0.9)' – stecb