The p tag removes the spaces and uses the text box to retain the spaces

Requirement: I need to retain spaces in a piece of text. I first used the p tag, but the spaces will be converted. Here it is represented by texteara.

Insert image description here

outline: none; // 隐藏文本框获取焦点时的边框
 resize: none; // 不可调整texteara的大小
 width: 540px
;
 height: 149px
;
 font-size: 16px;
 background: transparent;
 border: 0px
;
 font-family: MicrosoftYaHei;
 font-weight: normal;
 font-stretch: normal;
 line-height: 30px;
 letter-spacing: 0px;
 overflow: hidden;
 text-overflow: ellipsis;
 display: -webkit-box;
 -webkit-line-clamp: 5; // 文字超过多少行后显示...
 -webkit-box-orient: vertical;
 color: #666666;
 text-align: left;
 margin-top: 8px
;

Guess you like

Origin blog.csdn.net/weixin_48300785/article/details/126829041