css3~图片垂直居中

2017.03.07

img外部div标签:

div {
    display: table-cell;
    width: 1em;
    height: 1em;
    font-size: 144px;
    width: 144px;
    height: 144px;
    font-size: 118px;
    border: 1px solid #beceeb;
    text-align: center;
    vertical-align: middle;
}

img标签:

img {
    vertical-align: middle;
}

html代码:

![](xxx.jpg)

你可能感兴趣的:(css3~图片垂直居中)