0
点赞
收藏
分享

微信扫一扫

div中图片img水平垂直居中

冬冬_79d4 2022-03-24 阅读 130
css3vue.js
<div class="seeImg">
    <img :src="url"/>
</div>
    .seeImg {
        width: 100%;
        height: 100%;
        background: url("../assets/images/background.png") no-repeat center;
        background-size: 100% 100%;
        position: relative;
    }

    .seeImg img {
        width: auto;
        height: auto;
        max-height: 100%;
        max-width: 100%;
        position: absolute;
        top: 0;
        bottom: 0;
        left: 0;
        right: 0;
        margin: auto;
    }
举报

相关推荐

0 条评论