html

What do < And > Stand For?

&lt” and “&gt” are entity names for “less than” and “greater than” signs. These signs are “reserved” in HTML language for “opening” and “closing tags”. To resolve this issue, HTML provides a list of character entities along with entity numbers. Now as a replacement, entity names or numbers can be used. This blog demonstrates the meaning and usage of &lt and &gt signs along with alternatives.

What do &lt; And &gt; Stand For?

The “&lt” stands for a “less than” sign and “&gt” stands for a “greater than” sign, are famous character entities. It’s a bad approach to use these signs directly in the HTML file. It is because the browser can mix these signs with opening and closing tags.

How to Use &lt?

The less-than sign “<” is reserved in the HTML file. That’s why its entity name “&lt” is used to display the less-than sign on the web page.

Example

Creates an HTML file and adds “<h3>” and “<h2>” tags and sets the color of sea green to “<h2>” tag:

<!DOCTYPE html>

<html>

<body>

<h3> Using HTML Entity name for displaying Less than sign</h3>

<h2 style="color: seagreen;">The less-than sign: &lt; </h2>

</body>

</html>

The web page looks like this:

The output displays that, “&lt;” is converted into less than sign on the webpage.

How to Use &gt?

As the greater than sign “>” is reserved for the closing symbol in the ending and closing tag. Therefore, the character entity name “&gt” will be used to display the “greater than” sign on the webpage.

Example

Creates a div element and adds “<h4>” and “<h2>” tags. Now write the entity name for the greater than sign to be display in the webpage:

<div>

<h4>Using HTML Entity name for displaying Greater than sign</h4>

<h2 style="color: seagreen;">The greater-than sign: &gt; </h2>

</div>

The web page looks like this:

The output displays greater than sign on the webpage.

Bonus Tip: Entity Numbers

Entity names are easy to remember but some browsers do not support all entity names. The supportability of the entity number is much greater than the entity name.

Below there is a demonstration about how to use entity numbers.

Entity Numbers for Less Than and Greater Than Signs

The process is the same for both entity names and entity numbers. Just put the entity number in place of the entity name. The entity number for less than sign is “&#60;”:

<div style="margin-left:20px">

<h4>Using HTML Entity numbers for displaying Less than sign</h4>

<h2 style="color: blue;">The less-than sign: < </h2>

</div>

The webpage looks like this:

The output illustrates that the entity number is converted into a “less than” sign.

The entity number for greater than sign is “>” the updated code snippet is:

<div style="margin-left:20px">

<h4>Using HTML Entity numbers for displaying Greater than sign</h4>

<h2 style="color: dodgerblue;">The greater-than sign: > </h2>

</div>

After updating the code, the webpage looks like this:

The output illustrates that the entity number “>” is converted into a “greater than” sign.

Conclusion

The “&lt” stands for a “less than” sign and “&gt” stands for a “greater than” sign, are famous character entities. These symbols can be added to an HTML file without disturbing the layout with the help of “Entity name” and “Entity Numbers”. Just input the name or number associated with that symbol/character on the place where the symbol is to be placed and it will display the symbol on the webpage. This blog successfully demonstrated the purpose and meaning of “&lt” and “&gt”.

About the author

Abdul Moeed

I'm a versatile technical author who thrives on adaptive problem-solving. I have a talent for breaking down complex concepts into understandable terms and enjoy sharing my knowledge and experience with readers of all levels. I'm always eager to help others expand their understanding of technology.