<meta charset="utf-8">
<title> div放一个图片上下居中 </title>
<style type="text/css">
.div1{
width:400px;
height:400px;
border:1px solid red;
display:table-cell;
vertical-align:middle;
text-align:center;
}
</style>
</head>
<body>
<span class="div1">
![](niu.png)
</span>
</body>
</html>
网友评论