【发布时间】:2016-02-09 05:55:05
【问题描述】:
我想知道如何使用 javascript/css 将默认光标位置设置在两行占位符文本之间,以便用户输入可以在输入字段中垂直居中(我认为这看起来更好)。
下面的演示
<textarea id="topic_title_input" placeholder="Hi there, I want the cursor caret starts in the middle of these two lines (veritcally) when onfocus"></textarea>
<style>
#topic_title_input{
font-size: 20;
border-color: orange;
color:black;
background-color: white;
/*text-indent:10px;*/
border:1px solid orange;
width:521px;
height:60px;
outline:none;
border-radius:3px;
resize:none;
padding:7px;
}
</style>
【问题讨论】:
-
现在说什么?也许包括您的意思的图像(以及您尝试过的任何代码)?
标签: javascript php jquery html css