div{width:250px;height:150px;background:#000;position:relative;} img{width:150px;position: absolute;left: 0;top: 0;right: 0;bottom: 0;margin: auto;}
<div><img src="https://www.baidu.com/img/baidu_jgylogo3.gif"/></div>
posted on 2016-04-28 20:13 .carl 阅读(167) 评论(0) 编辑 收藏 举报