我正在嘗試創建一個simlpe彈出蒙版以顯示圖庫圖像,並且我需要將內部div垂直和水平居中,我還有另一個問題在哪裏我需要div容器有一個完全符合圖像的邊框,我在想這個,我可以在中央div裏面放一個span標籤。創建具有邊框的居中div圖像的蒙版
我寧願不使用JavaScript來做到這一點,但如果涉及到,我會
反正這裏是我到目前爲止有:
http://jsfiddle.net/swmhtgx5/7/
HTML:
CSS:
body{background:lightgrey; }
.screen_mask{
position: fixed;
left: 0px;
top: 0px;
width: 100%;
height: 100%;
z-index: 5000;
background-color: #000000;
visibility: visible; text-align:center;
background-color: rgba(43, 44, 44, 0.7);
background: rgba(43, 44, 44, 0.7);
color: rgba(43, 44, 44, 0.7);
}
.screen_mask .image_container{
width:700px; margin:auto; height:300px; border:1px solid white; background-repeat:no-repeat; background-position:center; background-image:url('http://rendezvouswithrenee.files.wordpress.com/2012/11/stars.jpg');
}