1
我有以下的CSS和HTMLcode:顯示錶不是垂直居中文本移動
CSS
.table{
display:table;
height:100%;
width:100%;
}
.table-cell{
display: table-cell;
vertical-align: middle;
}
HTML
<div class="table">
<div class="table-cell">
<a class="cta cta-1" href="#">Shop Now</a>
</div>
它垂直居中文本上正確桌面,但我試着在我的手機上查看它(IPhone),它不起作用,文本是al登頂。爲什麼會這樣?你可以在這裏看到它。 http://machinas.com/wip/stradviarius/startpage/
另請參閱:http://blog.themeforest.net/tutorials/vertical-centering-with-css/。他們包括你正在嘗試(這不適合我,順便說一句),但也有其他建議。 –
在我的桌面上的Chrome中,它也不起作用。 –
它看起來像你的網站上沒有任何你包含在你的問題中的CSS。 –