我创建了一个灯箱,我想让它只响应css ......
它适用于firefox中的每个浏览器execpt(就像每次都很近)....
我真的不知道为firefox做css响应式img的方法是什么......
这是我的css的一个小例子:http://jsfiddle.net/qbtyD/7/
.light-box-container {
position: fixed;
display: table;
vertical-align: baseline;
width: 100%;
height: 100%;
top: 0;
left: 0;
margin: 0 auto;
padding: 0 auto;
background: rgba(0,0,0,0.8);
cursor: pointer;
}
.light-box-inner {
position: relative;
display: table-cell;
vertical-align: middle;
margin: 0 auto;
padding: 0 auto;
}
.light-box-image {
position: relative;
text-align: center;
}
.light-box-image img {
position: relative;
width: auto;
max-width: 80%;
height: auto;
max-height: 90%;
margin: 0 auto;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
-webkit-box-shadow: 0px 0px 40px rgba(0,0,0,0.8);
-moz-box-shadow: 0px 0px 40px rgba(0,0,0,0.8);
box-shadow: 0px 0px 40px rgba(0,0,0,0.8);
}
答案 0 :(得分:0)
我得到的就像这样:http://jsfiddle.net/qbtyD/8/
.light-box-container {
position: fixed;
vertical-align: baseline;
width: 100%;
height: 100%;
top: 0;
left: 0;
margin: 0 auto;
padding: 0 auto;
background: rgba(0,0,0,0.8);
cursor: pointer;
}
.light-box-image {
position: relative;
height: 100%;
margin: 0 auto;
padding: 0 auto;
text-align: center;
}
.light-box-image img {
max-height: 90%;
max-width: 80%;
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
margin: auto;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
-webkit-box-shadow: 0px 0px 40px rgba(0,0,0,0.8);
-moz-box-shadow: 0px 0px 40px rgba(0,0,0,0.8);
box-shadow: 0px 0px 40px rgba(0,0,0,0.8);
}