Html 做什么 和 > 代表?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/5068951/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
What do < and > stand for?
提问by Michiel Pater
I know that the entities <
and >
are used for <
and >
, but I am curious what these names stand for.
我知道实体<
and>
用于<
and >
,但我很好奇这些名称代表什么。
Does <
stand for something like "Left tag" or is it just a code?
是否<
代表类似“左边的标记”或者是它只是一个代码?
回答by biscuitstack
<
stands for the less-than sign( < )>
stands for the greater-than sign( > )≤
stands for the less-than or equals sign ( ≤ )≥
stands for the greater-than or equals sign ( ≥ )
回答by James Goodwin
<
Less than: <
<
少于: <
>
Greater than: >
>
比...更棒: >
回答by meder omuraliev
They're used to explicitly define less than and greater than symbols. If one wanted to type out <html>
and not have it be a tag in the HTML, one would use them. An alternate way is to wrap the <code>
element around code to not run into that.
它们用于显式定义小于和大于符号。如果想要输入<html>
而不是将其作为 HTML 中的标签,则可以使用它们。另一种方法是将<code>
元素包装在代码周围,以免遇到这种情况。
They can also be used to present mathematical operators.
它们还可用于表示数学运算符。
<!ENTITY lt CDATA "<" -- less-than sign, U+003C ISOnum -->
<!ENTITY gt CDATA ">" -- greater-than sign, U+003E ISOnum -->
回答by Mārti?? Briedis
< == lesser-than == <
> == greater-than == >
回答by Greg Treleaven
<
= less than <
, >
= greater than >
<
= 小于<
, >
= 大于>
回答by BKSpurgeon
Others have noted the correct answer, but have not clearly explained the all-important reason:
其他人已经注意到正确答案,但没有清楚地解释最重要的原因:
- whydo we need this?
- 为什么我们需要这个?
What do < and > stand for?
< 和 > 代表什么?
<
stands for the<
sign. Just remember: lt == less than>
stands for the>
Just remember: gt == greater than
<
代表<
标志。请记住:LT ==升ESS牛逼汉>
代表的是>
要记住:GT ==摹reater牛逼汉
Why can't we simply use the <
and >
characters in HTML?
为什么我们不能简单地在 HTML 中使用<
和>
字符?
- This is because the
>
and<
characters are ‘reserved' characters in HTML. - HTML is a mark up language: The
<
and>
are used to denote the starting and ending of different attributes: e.g.<h1>
and not for the displaying of the greater than or less than symbols. But what if you wanted to actually display those symbols? You would simply use<
and>
and the browser will know exactly how to display it.
- 这是因为
>
和<
字符是 HTML 中的“保留”字符。 - HTML 是一种标记语言:
<
和>
用于表示不同属性的开始和结束:例如,<h1>
和 不用于显示大于或小于符号。但是,如果您想实际显示这些符号怎么办?您只需使用<
and>
,浏览器就会确切地知道如何显示它。
回答by Kathir
> and <
is a character entity reference for the >
and <
character in HTML.
> and <
是HTML 中>
和<
字符的字符实体引用。
It is not possible to use the less than (<) or greater than (>) signs in your file, because the browser will mix them with tags.
不能在文件中使用小于 (<) 或大于 (>) 符号,因为浏览器会将它们与标签混合。
for these difficulties you can use entity names(>
) and entity numbers(<
).
对于这些困难,您可以使用实体名称(>
)和实体编号(<
)。
回答by tejasgupta
<
stands for lesser than (<) symbol
and, the >
sign stands for greater than (>) symbol
.
<
代表lesser than (<) symbol
和,>
符号代表greater than (>) symbol
。
For more information on HTML Entities, visit this link:
有关 HTML 实体的更多信息,请访问此链接:
回答by zamoldar
In HTML, the less-than sign is used at the beginning of tags.
if you use this bracket "<test1>
" in content, your bracket content will be unvisible, html renderer is assuming it as a html tag, changing chars with it's ASCI numbers prevents the issue.
在 HTML 中,小于号用于标签的开头。如果您<test1>
在内容中使用此括号“ ”,您的括号内容将不可见,html 渲染器将其假定为 html 标签,使用它的 ASCI 数字更改字符可以防止出现此问题。
with html friendly name:
带有 html 友好名称:
<test1>
or with asci number:
或 asci 编号:
<test1>
or comple asci:
或完整的asci:
<test1>
result: <test1>
结果:<test1>
asci referance: https://www.w3schools.com/charsets/ref_html_ascii.asp
asci 参考:https://www.w3schools.com/charsets/ref_html_ascii.asp