Skip to content Skip to sidebar Skip to footer

Display Html Tag Characters As Plain Text

How do I display > Greater than < Less Than <> Not Equal to In the above code The greater than sign does no

Solution 1:

You need to use ampersand html character codes

Note the bolded < > signs in the first set.

<b>&gt; Greater than </b><b>&lt; Less Than </b><b>&lt;&gt; Not Equal to </b><p>&gt; Greater than 
    &lt; Less Than 
    &lt;&gt; Not Equal to 
</p>

Solution 2:

The characters “<” and “>” do appear in bold, they are just not as bold as you would expect. You can see this by trying with different font faces and sizes. E.g., in typical 12pt size Arial, they differ from non-bold characters visibly when you put them side by side.

Font designers may decide to avoid thick strokes in bold versions of special characters, since bolding is primarily meant for letters. Some special characters would look too odd if designed too bold.

Note that this has absolutely nothing to do with the representation of “<” and “>” as &lt; and &gt; in HTML source. It is generally recommended to escape “<”, but it is technically not necessary here (and “>” never needs to be escaped, though many people escape it for symmetry).

Solution 3:

Use &gt; and &lt; for greater and less than.

In addition, while the <b> tag is still part of the HTML spec, <strong> is much more semantic. Why do you ask? It is because bold is a style, whereas strong just says that this should be noticed, and leaves the styling out of it. Formatting is for CSS, defining structure and contents is a job for HTML.

Solution 4:

The greater than and less than signs are special characters in HTML. You need to write them as &gt; for greater than and &lt; for less than.

You'll notice that even then, the > and < signs aren't very bold. The difference becomes more pronounced as the font size increases. The font just doesn't add a whole lot of bolding to these characters.

Solution 5:

You can use :

"&#60;" or "&gt;" for "<"

use "&#62;" or "&gt;" for ">"

Refer this for more :- http://www.ascii-code.com/

Post a Comment for "Display Html Tag Characters As Plain Text"