Advertisement
Advertisement


What do < and > stand for?


Question

I know that the entities &lt; and &gt; are used for < and >, but I am curious what these names stand for.

Does &lt; stand for something like "Left tag" or is it just a code?

2017/10/31
1
490
10/31/2017 3:25:20 PM

Accepted Answer

  • &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:
2020/07/17
804
7/17/2020 2:15:39 AM

&lt; Less than: <

&gt; Greater than: >

2016/10/09

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

2011/02/21

&lt; ==  lesser-than == <
&gt; == greater-than == >
2011/02/21

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

2011/02/21

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.
2019/03/01

Source: https://stackoverflow.com/questions/5068951
Licensed under: CC-BY-SA with attribution
Not affiliated with: Stack Overflow
Email: [email protected]