<style>
#test{
width: 150px;;
min-height:20px;
max-height:70px;
outline: 0;
border: 1px solid #000;
font-size: 13px;
overflow-x: hidden;
overflow-y: auto;
-webkit-user-modify: read-write-plaintext-only;
}
[contentEditable=true]:empty:not(:focus):before{
content:attr(data-text);
}
</style>
</head>
<body>
<div id="test" contenteditable="true" data-text="输入留言"></div> </body>
相关文章
- div变成输入框
- codeforces708b// Recover the String //AIM Tech Round 3 (Div. 1)
- Codeforces Beta Round #9 (Div. 2 Only) E. Interesting Graph and Apples 构造题
- AIM Tech Round (Div. 2) C. Graph and String
- Codeforces Round #324 (Div. 2) E. Anton and Ira 贪心
- Codeforces Round #497 (Div. 2)B. Turn the Rectangles
- Codeforces Round #497 (Div. 2) A. Romaji
- Codeforces Round #497 (Div. 2) C. Reorder the Array
- 弹出DIV锁定代码
- DIV中的垂直居中