我让 Img 悬停是为了好玩。但现在我的 div 中有一些文本。我使用了代码:
display: table-cell;
vertical-align: middle;
让文本在我的 div 中完美居中。我也有这个代码:
.vertical-smallborder{
position: relative;
width: 217px;
height: 350px;
border: 5px solid white;
outline: 1px solid #c8c8c8;
float:left;
display: table;
-webkit-transition: all .3s;
-moz-transition: all .3s;
-ms-transition: all .3s;
-o-transition: all .3s;
transition: all .3s;
overflow: hidden;
}
我得到display: table
了那里的文字。如果我删除它,文本将不会在 div 中居中。
现在我遇到了溢出问题:隐藏。在FireFox和IE中溢出:如果有display: table
.
Google Chrome和Safari既支持display: table
又Overflow:hidden
一起支持。
注意:它必须是纯 CSS。所以我不能使用任何javascript。
谢谢