利用line-height(行高) 和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>

CSS - 文字垂直居中

相关文章:

  • 2021-12-04
  • 2021-04-23
  • 2021-08-05
  • 2021-06-08
  • 2021-11-24
猜你喜欢
  • 2022-12-23
  • 2022-01-09
  • 2022-01-13
  • 2022-12-23
  • 2021-08-05
  • 2022-02-13
  • 2021-12-05
相关资源
相似解决方案