无法看到换行符< BR>突出显示时 [英] Cannot see line break <BR> when highlighted

查看:69
本文介绍了无法看到换行符< BR>突出显示时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在div内容可编辑的情况下,突出显示时,我看不到BR的厚度,就像这样:



我希望它能像MS Word一样



(更新:早前输入错误 - 指出的语法错误)
顺便说一句,< BR> 是封闭的像这样

 < div contenteditable ='true'> < DIV> <跨度><峰; br />< /跨度> < / div>< / div>  

CSS来设置BR的厚度?或者有另一种方式?请解释一下。谢谢!

< 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 &nbsp; 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>
&nbsp;
<br>
test
</span>
</div>

<div>
<h4>test 3</h4>
<span>test
<br/>
&nbsp;
<br/>
test
</span>
</div>
</div>

UPDATE :

This works, because just like MSWord, you should put white space for a new line (&nbsp; for HTML). So you can highlight the text and see the new lines.

这篇关于无法看到换行符&lt; BR&gt;突出显示时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆