Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

243
Views
How to allow and show extra spaces in html

If I have a web page with the following text:

'This is some (a bunch of extra spaces in here) test print'.

..it will show as 'This is some test print'.

But is there a way to keep extra spaces in there without using 'nbsp;' for them?

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

Either wrap your text within <pre> tags or set the white-space property to pre

Examples:

p {
  white-space: pre;
}
<p>This is some                                    test print</p>

<pre>This is some                                  test print</pre>

about 4 years ago · Juan Pablo Isaza Report

0

There are various ways

  1. Using special character
&nbsp;
  1. Using pre tag as mentioned by @j08692

  2. using an inline element with the desired width & height without content

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!