且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在文本区域中垂直居中放置文本?

更新时间:2022-03-02 10:03:53

我认为你无法直接进行垂直对齐。您应该在文本区域上再创建一个div,并使用它使文本垂直对齐,然后将用户输入的内容输入到textarea,然后使用JS将其传输到div。

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.