2014-07-17 67 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