我有这个 HTML:
<div style="border:1.00px solid #000000;display:inline;">
<span style="font-family:Arial;font-size:20pt;">this is some text</span>
</div>
我想应用边框来仅覆盖文本。边框不覆盖跨度的整个高度。这是什么原因?
编辑:
<div>
<div style="border:1.00px solid #000000;display:inline-block;">
<span style="font-family:Arial;font-size:20pt;">this is some text this is some text this is some this is some text</span>
</div>
<span style="font-family:Arial;font-size:20pt;">this is some text</span>
</div>
我将“inline”更改为“inline-block”。在那种情况下,跨越多行且具有边框的行实际上不仅覆盖了文本。我正在尝试的是,如果整个文本的只有一部分有边框。边框盖是整条线。这是正常现象还是我可以解决这个问题?
最佳答案
Use "display: inline-block;" instead of 'display:inline'.
关于html - 跨度上的内联 div 不覆盖全文高度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35692671/