Is there a way to vertically center text entered in textarea with known width and height? I have a fixed-sized textarea where text should be typed in and I want the text to start from the center while you type it. Horizontal centering could be done with text-align:center, but I cant find any way to align horizontally.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
I think you cannot do the vertical alignment directly. You should make another div over the text area and use it to make text vertically aligned and take the inputs from user to the textarea and transfer it to the div using the JS.
And make the textarea invisible only.