图片居中原比例显示
2018-09-12 本文已影响0人
shaguamayi
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Manifest</title>
<link rel="manifest" href="./manifest.json"> <!-- 引用manifest文件 -->
<style type="text/css">
.wapper{
width:200px;
height:200px;
display:-webkit-box;
display:-ms-flexbox;
display: flex;
-webkit-box-pack:center;
-ms-flex-pack:center;
justify-content:center;
-webkit-box-align:center;
-ms-flex-align:center;
align-items:center;
border:solid 1px red;
}
.wapper img{
max-width:150px;
max-height:150px;
display:block;
}
</style>
</head>
<body>
<div class="wapper">
<img src="timg.jpeg">
</div>
<div class="wapper">
<img src="bannercopy.png">
</div>
<div class="wapper">
<img src="lxwmlogo.png">
</div>
<script>
</script>
</body>
</html>
image.png