<分区>
<分区>
我有这样的标记:
<p>This is first line off text. <br>
This is second line of text.
</p>
我想通过像这样添加 style="display:inline"来显示内联文本:
<p style="display:inline">This is first line off text. <br>
This is second line of text.
</p>
但是不行,请问有什么css方法可以实现吗?
非常感谢
最佳答案
您可以在 <br>
上使用 display: none标签。我会根据 inline
设置它在 <p>
上设置的类父标签。 JSFIDDLE DEMO
p.inline br {
display: none;
}
<p class="inline">This is first line off text. <br>
This is second line of text.
</p>
关于html - 如何使用 <br> 显示内联文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28069983/