本文介绍了无法看到换行符< BR>突出显示时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在div内容可编辑的情况下,突出显示时,我看不到BR的厚度,就像这样:
我希望它能像MS Word一样
(更新:早前输入错误 - 指出的语法错误)
顺便说一句, 在< br> 标记之后。
< div contenteditable ='true'>< div>< h4> test 1< / h4>< span>测试< / span>测试< / span> < / div>< div>< h4> test 2< / h4>< span>测试& nbsp;< br>测试< / span>< / div>< div> < h4> test 3< / h4>< span> test< / $ c $< / div>测试< / span>< / div><
更新:
$ b $ b这可以起作用,因为就像MSWord一样,您应该为新行添加空格(& nbsp; 用于HTML )。因此,您可以突出显示文本并查看新行。
In a div content editable, when highlighting, I can't see the thickness of the BR just like this:
I want it to be like this in MS Word
(Updated: Typo earlier -- wrong syntax as pointed out) By the way, the <BR> is enclosed like this
<div contenteditable='true'> <div> <span><br/></span> </div> </div>Should I use CSS to set BR's thickness? or there's another way? Please shed some light.Thanks!
解决方案Put after <br> tag.
<div contenteditable='true'> <div> <h4>test 1</h4> <span>test <br/> <br/> test </span> </div> <div> <h4>test 2 </h4> <span>test <br> <br> test </span> </div> <div> <h4>test 3</h4> <span>test <br/> <br/> test </span> </div> </div>UPDATE :
This works, because just like MSWord, you should put white space for a new line ( for HTML). So you can highlight the text and see the new lines.
这篇关于无法看到换行符< BR>突出显示时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
08-30 14:24