高亮时如何消除线条之间的空间?

时间:2017-04-24 18:22:26

标签: html css html5 css3

我正在使用自定义文本编辑器,我正在尝试通过突出显示选择消除行之间的空格,如下所示。我不确定如何在不从根本上改变HTML结构的情况下解决这个问题,而我无法做到这一点。任何建议都非常感谢。

修改:我不想简单地降低行高。我宁愿延长突出显示占用的垂直空间量。

enter image description here



p {
  display: block;
  font-family: Montserrat;
  font-size: 13px;
  height: 19px;
  line-height: 19.5px;
  margin-bottom: 0px;
  margin-top: 0px;
  overflow-wrap: break-word;
  overflow-x: hidden;
  overflow-y: hidden;
  text-indent: -3px;
  user-select: none;
  white-space: pre-wrap;
  width: 498.5px;
  word-wrap: break-word;
  -webkit-margin-after: 0;
  -webkit-margin-before: 0;
  -webkit-margin-end: 0;
  -webkit-margin-start: 0;
  -webkit-user-modify: read-write-plaintext-only
}

span {
  display: inline;
  font-family: Montserrat;
  font-size: 13px;
  height: auto;
  line-height: 19.5px;
  overflow-wrap: break-word;
  overflow-x: hidden;
  overflow-y: hidden;
  text-indent: -3px;
  user-select: none;
  white-space: pre-wrap;
  width: auto;
  word-wrap: break-word;
  -webkit-user-modify: read-write-plaintext-only
}

<p data-key="838">
  <span data-key="837">
    <span data-offset-key="837-0">
    Line of text one
    </span>
  </span>
</p>
<p data-key="842">
  <span data-key="841">
    <span data-offset-key="841-0">
    Line of text two
    </span>
  </span>
</p>
<p data-key="844">
  <span data-key="843">
    <span data-offset-key="843-0">
    Line of text three
    </span>
  </span>
</p>
&#13;
&#13;
&#13;

0 个答案:

没有答案