Technology Sharing

Perfect solution for the space problem caused by editor line breaks in p tag text paragraphs

2024-07-08

한어Русский языкEnglishFrançaisIndonesianSanskrit日本語DeutschPortuguêsΕλληνικάespañolItalianoSuomalainenLatina


In an HTML document, how do you write a long paragraph of text within a (p tag) without
Line break. Because the IDE or editor interface is limited in size or needs to process dynamically displayed text in Vue, a line is too long to write, and you need to press Enter to break the line. At this time, a space will appear in the document displayed by the browser.
Attached is the perfect solution:

1. Code before modification:

  • It can be seen from the code that the editor has wrapped the p tag, and a space appears for each line break in the display effect of the p tag text content on the page.