📜  垂直对齐 div 中的图像 - 任何代码示例

📅  最后修改于: 2022-03-11 14:59:31.810000             🧑  作者: Mango

代码示例2
.frame { height: 160px; /* Can be anything */ width: 160px; /* Can be anything */ position: relative; } img { max-height: 100%; max-width: 100%; width: auto; height: auto; position: absolute; top: 0; bottom: 0; left: 0; right: 0; margin: auto; }