top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

How to preserve white spaces in html?

0 votes
637 views
How to preserve white spaces in html?
posted Apr 24, 2018 by anonymous

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

2 Answers

0 votes

Using pre tag we can preserve whitespace in HTML.

Example:

<pre>Query     Home</pre>

Also, using CSS we can preserve white space by using below styles.

.element  { 
   white-space: pre; 
}
answer Apr 30, 2018 by Sandeep Bedi
0 votes

Hello...

Using <PRE> to preserve white space, tabs, and line breaks can come in very useful with certain types of content.

<pre>Content here</pre>
answer Jan 20, 2020 by Siddhi Patel
Similar Questions
0 votes

Create a webpage that displays the hyperlink with the following color attributes.

  • Set the color as %FF0000 for unvisited link
  • Set the color as %FF00 for visited link
  • Set the color as %FF00FF for mouse over link
  • Set the color as %0000FF for selected link
...