Languages

HTML - how to display newline characters located in the text in the source code?

6 points
Asked by:
sienko
743

Is it posiible to display newline characters, in text on my webpage, that are located in my HTML source code?

My source code:

 

Currently, my webpage displays the text:

I want to get:

1 answer
1 points
Answered by:
Root-ssh
178180

In HTML you can use <br /> elements.

 

In CSS, you can use one of the:

  1. white-space: pre;
  2. white-space: pre-line;
  3. white-space: pre-wrap;

Example:

 

0 commentsAdd comment
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.
Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join