如何阻止contenteditable div溢出?

时间:2019-06-17 16:52:16

标签: html css contenteditable

我正在与一个内容可编辑的div一起工作,我已经为其设置了一个高度,并试图用def search_by_extension(self, extension): cursor.execute("""SELECT * FROM files WHERE extension LIKE ?""", ('%' + extension + '%',)) overflow: hidden;将该字段切成高低,但是没有隐藏任何那个文本,它只是使div溢出。我该如何解决?

text-overflow: hidden;
#editor {
    height: 1100px;
    border: .5px solid gray;
    padding: 75px;
    padding-bottom: 75px;
    text-overflow: clip;
}
#editor:focus {
    outline: none;
}

1 个答案:

答案 0 :(得分:1)

尝试用overflow-y: scroll代替#editor

#editor {
    height: 1100px;
    border: .5px solid gray;
    padding: 75px;
    padding-bottom: 75px;
    text-overflow: clip;
    overflow-y: scroll;
}
#editor:focus {
    outline: none;
}
<div id="editor" contenteditable="true"></div>