Use of Various Tags in HTML5

In this article I am going to describe how to implement and use Em,Strong,Dfn,Kbd,Samp and Pre Tags in HTML5.
  • 1795

Em Tag in HTML5

<em> tag is used for emphasing on text or code.It emphasis only that text which is available in <em> tag.

Syntax

Syntax of <em>  tag

<em>Text to be Emphasized</em>

Browser Support

It is supported in all major browsers.

Strong Tag in HTML5

<strong > tag is used for highlighting the Text. Or, we can say that it is used for showing important text in the article. In HTML4.01 <strong> tag define strong emphasized text whereas HTML5 define it as important text.

Syntax

Syntax of <strong> tag

<strong>Some Text<strong>

Browser Support

It is supported in all major browsers.

Dfn Tag in HTML5

<dfn> tag is used for indicating or describing the defination.

Syntax

Syntax of <dfn> tag

<dfn>Defining some Text</dfn>

Browser Support

It is supported in all major browsers.

Kbd Tag in HTML5

<kbd> tag is used for specifying user input (Keyboard Text). This tag always occur in pair.

Syntax

Syntax of <kbd> tag

<kbd>Some Text</kbd>

Browser Support

It is supported in all major browsers.

Samp tag in HTML5

 <samp> tag is used for specifying the output of a computer program or system in the html document. This tag must have opening and closing tags.

Syntax

Syntax of <samp> tag

<samp>Defining some Text</samp>

Browser Support

It is supported in all major browsers.

Pre Tag in HTML5

<pre> tag defines preformatted text. This tag preserve both spaces and line break.

Syntax

Syntax of <pre> tag

<pre>Some Text</pre>

Browser Support

It is supported in all major browsers.

Example using various tag in HTML5

<!DOCTYPE html>

<html lang="en" xmlns="http://www.w3.org/1999/xhtml">

<head>

    <title>Various tags in HTML5</title>

</head>

<body>

    <p><b>Implementation of &lt;em&gt; tag in HTML5.</b></p>

    MCN is a<abbr title="Information Technology"><em>IT</em> </abbr>

    Company.

    <p><b>Implementation of &lt;strong&gt; tag in HTML5.</b></p>

    Company Name is <strong>MCN Solution</strong>situated in <strong>Noida Sector 63</strong>.

    <p><b>Implementation of &lt;dfn&gt; tag in HTML5</b></p>

    <dfn>Internet Explorer</dfn> is the most popular browser.

    <p><b>Implementation of &lt;kbd&gt; tag in HTML5</b></p>

    <kbd>Kbd Tag is used for representing user input</kbd>

    <p><b>Implementation of &lt;samp&gt;in HTml5</b></p>

    This is

    <samp>sample text</samp>

    in HTML5.

    <p><b>Implementation of &lt;pre&gt; tag in HTML5</b></p>

    <pre>HTML5 is the Fifth revision and

the newest version of HTML standard.It offers

new features that provide not only rich media support

but also enhance support      for creating web applications.</pre>

</body>

</html>

Output

tag.jpg

© 2020 DotNetHeaven. All rights reserved.