The var Tag

The `<var>` tag is used to specify a variable in a mathematical equation or a computer program. In most browsers, the content of this tag is displayed in italic format.

Syntax:

<var> Contents... </var>

Example: To demonstrate using the <var> tag in HTML that denotes variables and it is styled to differentiate them from regular text, providing emphasis on their significance within the content.

html
<!DOCTYPE html>
<html>

<head>
    <title>var tag</title>
    <style>
        body {
            text-align: center;
        }

        .geeks {
            font-size: 25px;
            font-weight: bold;
        }
    </style>
</head>

<body>
    <div class="geeks">&lt;var&gt; Tag</div>
    <var>w3wiki Variable</var>
</body>

</html>

Output: 

Output

HTML Computer Code Elements

The computer has a unique formatting and text style for displaying the messages related to codes. There are several elements available to mark up computer code elements using HTML which are as follows:

Table of Content

  • The code Tag
  • The kbd Tag
  • The pre Tag
  • The samp Tag
  • The var Tag
  • HTML Computer Code Elements
  • Supported Browsers

Similar Reads

The code Tag

The `` tag in HTML is designed to display computer code snippets with fixed formatting for optimal readability. It renders the code in a monospace font, preserving the original spacing and layout. The `` tag also supports both global attributes and event attributes, allowing for flexible styling and interaction....

The kbd Tag

The `` tag is used to define keyboard input. The text between the `` tags represents text that should be typed on a keyboard. This text is typically displayed in the browser’s default monospace font, though a richer effect can be achieved with CSS. The `` tag has no specific attributes....

The pre Tag

The `

` tag in HTML defines a block of preformatted text, preserving spaces, line breaks, tabs, and other formatting characters that browsers usually ignore. Text within the `
` element is displayed in a fixed-width font, but this can be changed using CSS. The `
` tag requires both opening and closing tags....
													

The samp Tag

The `` tag is used to define sample output from a computer program. It encloses inline text representing a sample or quoted output from a program....

The var Tag

The `` tag is used to specify a variable in a mathematical equation or a computer program. In most browsers, the content of this tag is displayed in italic format....

HTML Computer Code Elements

The table below shows the HTML Computer Code Tags with their description:...

Supported Browsers

Google ChromeMicrosoft EdgeFirefoxOperaSafari...

Contact Us