Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
3 Odpowiedzi
17072 Widoki

How to insert line break in placeholder in text area field?

 

Awatar
Odrzuć

Hello ,

You get any solution because i am facing similar problem.

Najlepsza odpowiedź

I am surprised no one came up with a working solution in the last 9 years.

You can simply add & # 1 0 ; (without spaces) to your placeholder text, browser will register it as line feed.

Awatar
Odrzuć
Najlepsza odpowiedź

Is it possible ?? ;) Have you tried \n \r ?

Awatar
Odrzuć
Autor

yes tried that didn't work.

Najlepsza odpowiedź

Only by formatting with multiple spaces, e.g.:

1st line of placeholder starts here                                         2nd starts here            etc    

If the size of textarea is fixed, browsers will show such long texts as if they were on multiple lines.

You'll have to fine-tune the number of spaces to make placeholder text look as you like.

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
1
lip 16
4380
0
lip 16
5254
1
gru 15
3847
1
lis 15
5251
1
sty 24
15843