[英]Images do not vertically align properly within div in Safari
images
div中的images
在Chrome,Firefox和IE中似乎可以垂直對齊並正確居中,但在Safari中則不能。 在Safari中,圖片被推到images
div的下方/之外,並出現在div的下方,像這樣滲入到description
div中:
http://postimg.org/image/vsoifbf1x/
下面是幻燈片的jsfiddle,顯示了居中對齊的第一個圖像。 由於我如何引用數組中的圖像,因此JS無法使用,但是幻燈片對我有用,我只關心圖像垂直對齊。 它們可以在jsfiddle,Chrome和Firefox中正確對齊,但不能在Safari中對齊:
#images {
height: 548px;
width: 898px;
border: 1px solid #000000;
text-align: center;
}
#images img {
opacity: 1;
top: 50%;
transform: translateY(-50%);
position: relative;
}
這是可能適合您的代碼。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.