how to expand a text area when click on

后端 未结 9 1412
感情败类
感情败类 2021-02-02 10:17

Im working on a small project which has a textarea and i need help in making the text area expand on mouse click like that of twitter and facebook. the textarea should look lik

9条回答
  •  萌比男神i
    2021-02-02 10:21

    This can be done without the use of JavaScript/jQuery, using CSS transitions.

    textarea {
        height: 1em;
        width: 50%;
        padding: 3px;
        transition: all 0.5s ease;
    }
    
    textarea:focus {
        height: 4em;
    }

提交回复
热议问题