2
我试图使用CSS显示表格单元格垂直居中图像。为什么我的代码不工作?它看起来像它应该根据CSS-tricks.css显示表格单元格不工作的垂直居中图像
http://css-tricks.com/centering-in-the-unknown/
.cont {
background-color: grey;
position: fixed;
height: 100%;
width: 100%;
display: table;
}
img {
display: table-cell;
vertical-align: middle;
}
<div class="cont">
<img src="http://www.quarktet.com/Icon-small.jpg" />
</div>