跳至內容
選單
此問題已被標幟
3 回覆
16906 瀏覽次數

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

 

頭像
捨棄

Hello ,

You get any solution because i am facing similar problem.

最佳答案

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.

頭像
捨棄
最佳答案

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

頭像
捨棄
作者

yes tried that didn't work.

最佳答案

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.

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
1
7月 16
4294
0
7月 16
5185
1
12月 15
3735
1
11月 15
5186
1
1月 24
15719