2014-07-17 70 views

回答

7

铬似乎有些高度自动分配到CONTENTEDITABLE段落,但Firefox不。简单的解决方案是为段落添加最小高度。

<p contenteditable="true" style="min-height:15px"></p> 

现在我们不担心多余的空格和不必要的BR标签

+0

为我工作。非常感谢mundella。 –

+0

辉煌的人生救星。谢谢编码器 – Slayer6

+0

Awsome,它适用于Firefox – Buminda

1

CSS解决方案:

p[contenteditable] { min-height: 1em} 
/* or more generic for any element*/ 
[contenteditable] { min-height: 1em} 

DEMO