Desu Desu -4 years ago 131
CSS Question

Cannot see line break <BR> when highlighted

In a div content editable, when highlighting, I can't see the thickness of the BR just like this:
enter image description here

I want it to be like this in MS Word

enter image description here

(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!

Answer Source

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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download