Use line-height (line height) to be consistent with height
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<style>
div {
height: 50px;
width: 200px;
background-color: pink;
line-height: 50px;
}
</style>
</head>
<body>
<div>我是行高</div>
</body>
</html>