Html 悬停时的文本下划线更改填充

Html 悬停时的文本下划线更改填充,html,css,Html,Css,我在css中添加悬停下划线样式时遇到问题。每当我将鼠标悬停在文本上方时,填充/边距都会出现异常。我不知道为什么。这是网站 它似乎正在将您的行高度从3rem更改为0.15 请参见原始css: h2{ 字体系列:“EB Garamond”,衬线; 字体大小:1.9rem; 线高:3rem/* h2:hover { position: relative; border-bottom: 10px solid #85C0DB; display: inline-block;

我在css中添加悬停下划线样式时遇到问题。每当我将鼠标悬停在文本上方时,填充/边距都会出现异常。我不知道为什么。这是网站


它似乎正在将您的
行高度从3rem更改为0.15

请参见原始css:

h2{
字体系列:“EB Garamond”,衬线;
字体大小:1.9rem;
线高:3rem/*
h2:hover {
    position: relative;
    border-bottom: 10px solid #85C0DB;
    display: inline-block;
    line-height: 0.15;
    transition: 0.3s ease;
    margin: 0
}