html tutorial - <var> Variable Tag in HTML - html5 - html code - html form



var tag

Learn html - html tutorial - var tag - html examples - html programs

  • <var> tag is used to display a variable. That can be a mathematical expression or a computer code.
  • <var> tag is also known as Phrase tag.
  • <var> tag is supports both Global and Event attributes.
  • The <var> tag is belonging to Phrasing content category.

Syntax for <var> tag:

<var>content</var>

Sample Coding for <var> tag in HTML:

Tryit<!DOCTYPE html>
<html >
    <head>
        <title>Wikitechy var tag</title>
    </head>
    <body>
        <h2>HTML var tag with example.</h2>
        <p>Solve the equation
            <var>y</var>=<var>x</var>+4
        </p>
    </body>
</html>

Code Explanation for <var> tag:

Variable <var> Tag Code Explanation

  1. <var> tag is used to define “y” and “x” as variable.

Output for <var> tag:

Variable <var> Tag Output

  1. “y=x+4” in this equation x and y are defined as <var> so that it will be shown in different formatting.

Browser Support for <var> tag in HTML:

Yes Yes Yes Yes Yes

Related Searches to var tag in html