avoid ie contentEditable element to create paragraphs on Enter key

后端 未结 5 1903
小蘑菇
小蘑菇 2020-12-06 06:49

On InternetExplorer, a contentEditable DIV creates a new paragraph (

) each time you press Enter whereas Firefox creates a
5条回答
  •  北荒
    北荒 (楼主)
    2020-12-06 07:12

    Changing the line-height of the

    inside the editable

    works:

    #editable_div p
    {
        line-height: 0px;
    }
    

提交回复
热议问题