- 第一步
<div style="width:400px;height:400px">
<div class="aa">
</div>
</div>
第二步
.aa{
width: 100%;
height: 100%;
border: 1px solid #ccc;
background-image: url(http://localhost:8002/img/avatar.c58e4651.png);
background-repeat: no-repeat;
background-size:100% 100%;
}
效果
但是本着点赞自愿,收藏吃灰,还是多少可以支持一下。