<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>div中img垂直居中</title>
</head>
<style type="text/css">
div{
height:200px;
background:#eee;
vertical-align:middle;
}
img{
height:40px;
vertical-align:middle;
}
span{
height:100%;
display:inline-block;
vertical-align:middle;
}
</style>
<body>
<div>
<span></span>
<img src="https://www.baidu.com/img/bd_logo1.png" alt="" />
<a style="vertical-align: middle">徐同保</a>
</div>
</body>
div中img和a链接同时居中
最新推荐文章于 2024-09-26 23:39:18 发布