How to set the whitespace between text in CSS?


To set the whitespace between text, use the white-space property. Possible values are normal, pre, nowrap.

Example

You can try to run the following code to set the whitespace between text in CSS:

<html>
   <head>
   </head>
   <body>
      <p style = "white-space:pre;">
         This text has a line break and the white-space pre setting tells the browser to honor
         it just like the HTML pre tag.</p>
   </body>
</html>

Updated on: 31-Jan-2020

120 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements