当文字只有一行或几行时,设置height 和 line-height 相等即可
<div class="title"> 我是文字 </div> <style> .title { height: 25px; line-height: 25px; } <style>