What do < and > stand for?
Asked Answered
B

10

639

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?

Brunhilde answered 21/2, 2011 at 17:9 Comment(7)
w3schools.com/HTML/html_entities.aspNobelium
Funny. I've been using these for ten years and hadn't realized what they stood for until now.Pretor
@LaurentS. "lt" = "less than" may only be easy to figure out if you took basic math instruction in English.Townswoman
what will be the code for \nBatsheva
means for > we use &gt; then what is for \n ?Batsheva
"Left tag" also made sense to me ;)Democratize
@Batsheva I cannot think of a reason to have a code for \n. HTML should treat this correctly without any confusion. Note that there are specific features of CSS relating to how whitespace is handled (I do not know them off the top of my head, sorry.)Landlubber
A
1033
  • &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:
Alkaloid answered 21/2, 2011 at 17:10 Comment(4)
@RonaldinhoLearnCoding &gt;= will display >=, but if you prefer to use the literal characters, greater or equal (≥) is &ge;, and less than or equal (≤) is &le;.Marbles
Hah. Always thought "Left Tag" and "Right Tag", but maybe RT was taken by Return, so it's using letter G from right instead of R...Pravit
What are these called?Singularity
@Singularity In ordinary English grammar these are "angle brackets". In HTML these are "HTML Entities" or "Reserved Characters": developer.mozilla.org/en-US/docs/Glossary/EntityLandlubber
L
127

&lt; Less than: <

&gt; Greater than: >

Landscapist answered 21/2, 2011 at 17:11 Comment(3)
I thought lt stands for left tag. But gt was breaking my assumption.Crucial
I can replace < with &lt; Similarly, what can I use for new line character?Lamebrain
@AnujBalan Perhaps you want the <br> tag? You don't need to escape a newline character in HTML. Most programming languages (notably JavaScript) use \n to escape newlines in strings. But if you want a paragraph character use &para; - also check out w3schools.com/tags/ref_entities.aspCapricorn
C
48

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

Contemporaneous answered 21/2, 2011 at 17:10 Comment(0)
M
34

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 do we need it?

  • 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 elements: 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.

Reference: https://dev.w3.org/html5/html-author/charref

Mitchiner answered 3/10, 2018 at 7:20 Comment(0)
D
22
&lt; ==  lesser-than == <
&gt; == greater-than == >
Dorotheadorothee answered 21/2, 2011 at 17:10 Comment(0)
A
15

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

Anuria answered 21/2, 2011 at 17:12 Comment(0)
D
10

&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;).

Duroc answered 5/3, 2013 at 12:22 Comment(3)
What is the character entity reference for 'new line character' ?Lamebrain
Check this link and this may help you in finding the new line character entity #3488698Duroc
Its &#10; Got it from a site.Lamebrain
D
7

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.

with html friendly name:

  &lt;test1&gt; 

or with asci number:

 &#60;test1&#62;

or comple asci:

&#60;&#116;&#101;&#115;&#116;&#49;&#62;

result: <test1>

asci referance: https://www.w3schools.com/charsets/ref_html_ascii.asp

Danndanna answered 11/4, 2020 at 23:37 Comment(0)
U
6

&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

Urine answered 12/10, 2018 at 6:57 Comment(2)
This does not add anything new above the many answers written years ago on this seven year old question... In the future, to avoid such duplication, please have a glance at existing answers before writing a new one.Wherefore
Ok. I''l do as you say.Urine
A
3

in :

&lt=    this is    <=
=&gt    this is    =>
Aspiration answered 29/9, 2014 at 10:27 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.