提问者:小点点

如何在背景色上得到较短的填充?


我很难把下面的填充物做得更短:

查看代码及其外观

我不想绿色背景接触上面的文字,我已经尝试了负面填充,但没有效果

提前致谢


共1个答案

匿名用户

你想要这样的底线文字不重叠以上的文字。您可以将行高添加到上述文本中,

line-height:60px;添加到h1标记

null

body{
  background:#3c52b0;
  color:#fff;
}
h1{
  font-size:50px;
  line-height: 60px;
}
.bottom{
  background-color: #2bd650;
  background-size:auto;
  font-weight: bold;
  font-style: italic;
}
<h1>company<br> that increases<br> you <span class="bottom">bottom-line<span><h1>