how to put < > and double space or multiple space in my html tag or in my element [duplicate]

how can I put <>'' or more space in html tag <>

this is my code that have problem.

<div>
  <p> > or < </p>
</div>

Solution 1:

You can use SGML HTML entities to render HTML's reserved characters:

  • &lt; = <
  • &gt; = >
  • &amp; = &
  • &quot; = "
  • &nbsp; = Non-breaking space

The &nbsp; entity is useful because browsers will collapse consecutive whitespace characters into one (so <p>Foo bar</p> and <p>Foo bar</p> will appear the same, but <p>Foo&nbsp;&nbsp;&nbsp;&nbsp;bar</p> will have the extra space).

...however you should not use &nbsp; for element spacing and layout (instead use CSS's margin and padding), and if you really do want non-collapsed whitespace then consider using CSS's white-space with pre, pre-wrap, or break-spaces (as only those values will not collapse consecutive spaces and tabs, while normal, nowrap, and pre-line will collapse spaces).


<div>
  <p> &gt;&nbsp;&nbsp;&nbsp;&nbsp;or&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt; </p>
</div>