sandi
sandi

Reputation: 127

how to write < inside an HTML element

I want to know how I can write some text in HTML without it being interpreted as a tag? I tried writing <p> <some text> 0</p> inside a paragraph and it only displays 0

Upvotes: 5

Views: 1734

Answers (2)

Tiago Rangel
Tiago Rangel

Reputation: 1328

&lt; for < and &gt; for >

Upvotes: 0

Div
Div

Reputation: 1603

Escape sequences are used to display a character which may otherwise be unsafe if used literally.
For a less-than sign (<) use &lt;
For a greater-than sign (>) use &gt;.

Upvotes: 7

Related Questions