What do < and > stand for?

蹲街弑〆低调 提交于 2019-11-26 19:17:45
biscuitstack
  • &lt; stands for the less-than sign ( < )
  • &gt; stands for the greater-than sign ( > )
  • &le; stands for the less-than or equals sign ( ≤ )
  • &ge; stands for the greater-than or equals sign ( ≥ )
James Goodwin

&lt; Less than: <

&gt; Greater than: >

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.

They can also be used to present mathematical operators.

<!ENTITY lt      CDATA "&#60;"   -- less-than sign, U+003C ISOnum -->
<!ENTITY gt      CDATA "&#62;"   -- greater-than sign, U+003E ISOnum -->

http://www.w3.org/TR/html4/sgml/entities.html

&lt; ==  lesser-than == <
&gt; == greater-than == >

&lt = less than <, &gt = greater than >

&gt; and &lt; is a character entity reference for the > and < character in 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(&gt;) and entity numbers(&#60;).

Others have noted the correct answer, but have not clearly explained the all-important reason:

  • why do we need this?

What do < and > stand for?

  • &lt; stands for the < sign. Just remember: lt == less than
  • &gt; stands for the > Just remember: gt == greater than

Why can’t we simply use the < and > characters in 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 &lt; and &gt; and the browser will know exactly how to display it.

in :

&lt=    this is    <=
=&gt    this is    =>

&lt; stands for lesser than (<) symbol and, the &gt; sign stands for greater than (>) symbol.

For more information on HTML Entities, visit this link:

https://www.w3schools.com/HTML/html_entities.asp

Hope my answer was helpful to you... Have a great day ahead...

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!