HTML 5 TutorialsEntities in HTML

Entities in HTML

As we know HTML is a tag based language, so if we use tags to design an Iframe in the HTML page. We can not use “<” or “>” sign in HTML because HTML consider this statement as a tag. So we have to use entities to write such elements inside an Iframe.

1) For “<” sign we use &lt (lt means less than)
2) For “>” sign we use &gt (gt means greater than)
3) For symbol of copyright(©) we use (&copy)
4) For Euro(€) sign we use (&euro)

Let us write a small program using all the above entities

CODE EXPLAINATION:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>
<h1>How are you &lt; Let me check &gt; &amp;&amp; &lt; Also Answer my other question &gt; &euro;&copy;</h1>
</body>
</html>

The output will be like

How are you < Let me check > && < Also Answer my other question > ۩

We can use different types of symbol by just learning their entity names also because entity names are supported by all browsers. You should now check for entities and try using them in your own script.

Exclusive content

- Advertisement -

Latest article

21,501FansLike
4,106FollowersFollow
106,000SubscribersSubscribe

More article

- Advertisement -