让一张图片居中在中间(代码片段)

.nodata{
margin: auto;
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
}

<img src="img/nodata.png" class="nodata">

 

posted @ 2018-08-11 15:18  好朋友阿九  阅读(418)  评论(0编辑  收藏  举报