在Safari

时间:2015-06-14 18:29:20

标签: javascript html css

images div中的图片似乎在Chrome,Firefox和IE中垂直对齐并居中,但在Safari中却没有。在Safari中,图片被推到images div的下方/外面,并显示在div下方,像description div那样流入 left: 50%; top: -90%; transform: translate(-50%, -90%); div:

http://postimg.org/image/vsoifbf1x/

下面是幻灯片的jsfiddle,显示第一个图像在中心对齐。由于我如何引用数组中的图像,JS将无法工作,但幻灯片适用于我,我只关心图像垂直对齐。它们在jsfiddle,Chrome和Firefox中正确对齐,而不是在Safari中:

http://jsfiddle.net/bytyrurh/

1 个答案:

答案 0 :(得分:2)

#images {
    height: 548px;
    width: 898px;
    border: 1px solid #000000;
    text-align: center;
}

#images img {
    opacity: 1;
    top: 50%;
    transform: translateY(-50%);
    position: relative;
}

Here's the code that will probably work for you.

相关问题