简体   繁体   English

用于保留尖括号的 HTML 标记

[英]HTML tag to preserve angular brackets

<pre> tag helps to preserve spaces and line brakes in HTML. <pre>标签有助于在 HTML 中保留空格和换行符。 But I've a text with angular brackets like -但是我有一个带有尖括号的文本,例如 -

<some text here>

and I want that to appear on web page as it.我希望它像它一样出现在网页上。 But if I've this text in html, it is not shown on the page.但是如果我在 html 中有这个文本,它不会显示在页面上。

Is there any HTML tag which is used to enclose the text will help to preserve angular brackets?是否有任何用于包含文本的 HTML 标记有助于保留尖括号?

use

&gt; to make > 

and

&lt; to make < 

Try this if works:试试这个,如果有效:

<xmp>
    <h1>Hello World</h1>
</xmp>

Or you can use &lt;或者你可以使用 &lt; for "<" and, &gt;对于“<”和,&gt; for ">"对于“>”

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM