i would like to show this text in my html code:
<html>
Name 1
Name 2
Managers
</html>
I tried to do this but then in the site it shows like this:
Name 1 Name 2 Managers.
If I put &l开发者_开发百科t;p>
on it, it will show like this:
<html>
<p>Name 1 </p>
<p> Name 2 </p>
<p> Managers </p>
The result is this:
Name 1
Name 2
Managers
Is there any code how to keep this single like?
Thanks
Perhaps you are looking for the <br>
tag.
Note that you can change the spacing provided by a <p>
tag by using CSS
properties like margin
, padding
, line-height
, etc.
In addition to the <br/>
, as others have pointed out, you can also enclose text content in the <pre></pre>
tag, which will preserve all the whitespace.
Use a line break <br>
<html>
Name 1<br>
Name 2<br>
Managers
</html>
From W3Schools.com:
In HTML the
<br>
tag has no end tag.
In XHTML the<br>
tag must be properly closed, like this:<br />
.
Try this:
<html>
Name 1<br />
Name 2<br />
Managers<br />
</html>
精彩评论