Is it possible to make INPUT
look like TEXTAREA
, at least in Chrome? DIV
converted to TEXTAREA with -webkit-appearance: textarea
works fine but INPUT
does not.
Asked
Active
Viewed 207 times
0

friedman
- 645
- 10
- 25
-
check this https://stackoverflow.com/questions/27037548/how-can-make-an-inputtype-text-element-to-work-as-textarea – Soothran Aug 20 '19 at 06:55
-
It is impossible now. Multi-line text is intended only for `textarea` – little_coder Aug 20 '19 at 07:02
-
...and for `DIV` appearing as `TEXTAREA`. That is why I found it strange that I can simulate it by `DIV` but not by `INPUT` which is a closer element. – friedman Aug 20 '19 at 07:46
1 Answers
0
The short answer is no.
Semantically and with accessibility in mind it isn't recommended to confused the two or fake the appearance. Just for clarity this is a single-line text input:
<input type="text" name="">
And this is a multiline text input:
<textarea rows="4" cols="50">Default value.</textarea>
Fundamentally they were built to be like that unfortunately.

Michael Gearon
- 445
- 1
- 4
- 16
-
Thank you for your suggestion! Yes, I know it is not recommended but in this case it's the only solution as we have a Saas software and no entry to admin panel edition. We can only make a kind of patch on a browser, user-side CSS rule. – friedman Aug 20 '19 at 07:50
-
Ah I see, yeah it's one of those things that it just isn't designed to do. I've just tested word-wrap and word-break as well as the overflow property to see if those would help out but they don't – Michael Gearon Aug 20 '19 at 07:57