Phrase Elements HTML5 | Phrase Tags

Phrase Elements or Phrase Tags Definition | Why We Use Phrase Tags?

The tags <em>, <strong>, <dfn>, <code>, <samp>, <kbd>, and <var> are called phrase tags or phrase elements in HTML.

Phrase elements are designed to markup parts of text according to their usage. So the browser will be able to render them a particular way. They help the browser to get the meanings of the text with the help of these phrase elements. We are going to tell you more about these HTML phrase elements with the help of the following code.

HTML Code Example:

<!DOCTYPE html>

<!-- Phrase Elements in HTML Language -->

 

<html lang='en'>

<head>

<meta charset="UTF-8" />

<title>

Phrase Elements (howtocode.pk)

</title>

</head>

<body>

 

<p>

Phrase Elements

</p>

 

<div style="padding-left: 24pt">

 

<p> <em> Emphasize </em> </p>

<p> <strong> Strong </strong> </p>

<p> <dfn> Define a term </dfn> </p>

<p> <code> Code listings </code> </p>

<p> <samp> Sample </samp> </p>

<p> <kbd> Keyboard </kbd> </p>

<p> <var> Variables </var> </p>

 

</div>

 

</body>

</html>

Output:

Phrase Elements

Emphasize

Strong

Define a term

Code listings

Sample

Keyboard

Variables

Explanation of HTML Phrase tags

In the above output you can see that we are showing you seven phrase elements. They are used for various purposes to help the web browser to render them accordingly. In the code the first phrase element is called the emphasize element and it uses the <em></em> tags emphasize any element of the text. The next is using the <strong></strong> tags to make the text bolder. Next one is using the <dfn></dfn> tags and is used to define a term in text. Next phrasing element is to display code in you HTML page. It uses the <code></code> tags to tell browser to handle this code as text code. The <samp></samp> tags are used to display a sample font. In the next line we are using <kbd></kbd> or keyboard tags are used for keyboard. At the end we have <var></var> tags which are used for variables.

So the phrase elements are used to markup text parts according to their usage. By the use of CSS you can style these elements and other elements as well to your requirement and desire.

Comments