我想做一個全屏燈箱的平穩過渡,我實際的代碼燈箱過渡
<a href="#_" class="lightbox" id="img1">
<img src="images/photo.jpg">
</a>
而且我的風格:
.lightbox {
display: none;
position: fixed;
z-index: 999;
width: 100%;
height: 100%;
text-align: center;
top: 0;
left: 0;
background: rgba(0,0,0,0.8);
}
.lightbox img {
max-width: 90%;
max-height: 80%;
margin-top: 2%;
}
.lightbox:target {
outline: none;
display: block;
transition:all 1s;
}
這真的很簡單,但過渡:一切似乎都不要使用顯示塊/無...任何想法?
它工作得很好,謝謝:) –