我有這樣的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-block的」。在這種情況下,跨越多行並具有邊框的線條不僅僅覆蓋文本。我所嘗試的是,如果只有整個文本的一部分有邊界。邊框封面是整條線。這是正常的,或者我可以爲此嗎?
I was expecting this output when using inline-block.
如果你還沒有想通出來,看看我的回答 – AVI