简体   繁体   English

插入多行写的textarea

[英]Insert textarea writed in more than one line

I have a textarea and the text that i write is inserted in a p. 我有一个textarea,我写的文本插入到p中。 I don't know why the text maked it's set in one line only, instead a few lines because i have an width with 300px. 我不知道为什么文本使它只设置在一行中,而是设置在几行中,因为我的宽度为300px。 This only breaks the line and write in more than one line all the text if i press "enter" in the textarea to write more. 如果我在文本区域中按“输入”以编写更多内容,则这只会中断行并在所有文本中写入多行内容。 For example, i write and if i press enter and write again, this breaks me the text in two lines, but i want to do this automatically, because the text it's wrapped in a p tag. 例如,我写,如果我再次按Enter键并写,这会将文本分成两行,但是我想自动执行此操作,因为该文本包装在p标记中。

Solution: I need to apply word-break: break-word; 解决方案:我需要应用word-break: break-word; to my p tag. 给我的p标签。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM