0
我在contenteditable div中有一個佔位符字符串。該字符串不以正常的方式顯示。這些單詞在一行的結尾處被打破。 請幫忙。我只需要在比線更長的時候才能打破這些詞,否則,這個詞應該從下一行開始。我已經在框中添加了單詞warp,但似乎不起作用。contenteditable div佔位符的文字換行
HTML:
<div contenteditable="true" id="box"></div>
CSS:
#box:empty:not(:focus):before{
content:"hello thank you thank you very much hello thank you thank you very much how are you";
font-style:italic;
color:red;
}
#box{
white-space: pre;
border:1px solid lightgrey;
height: 250px;
width: 350px;
word-wrap:break-word;
overflow: auto;
}
非常感謝。有用!!!! – Payson