0

我创建了一个灯箱,我想让它只用 css 响应......

它适用于 Firefox 中的每个浏览器 execpt(就像每次都一样)......

我真的不知道在 css 中为 firefox 制作响应式 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);
}
4

1 回答 1

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);
}
于 2013-10-02T23:49:41.180 回答