首页 > 其他 > 详细

图片垂直居中在中间

时间:2015-07-22 18:18:59      阅读:103      评论:0      收藏:0      [点我收藏+]
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>图片垂直居中在中间</title>
</head>
<style type="text/css">
.war {
    width:100%;
    height:100%;
    overflow:hidden;
    display:-webkit-box;
    -webkit-box-align:center;
    -webkit-box-pack:center;
    display:-ms-flexbox;
    -ms-flex-pack:center;
    -ms-flex-align:center;
    position:absolute;
    position:fixed;
    top:0;
    right:0;
    left:0;
    bottom:0;
}
.war img {
    max-height:100%;
    max-width:100%;
}
</style>

<body>
<div class="war"> <img src="image/2.jpg"> </div>
</body>
</html>

 

图片垂直居中在中间

原文:http://www.cnblogs.com/yjhua/p/4668027.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!