HTML var Tag

HTML <var> Tag: The HTML<var> tag is also a  phrase tag and used to specify the variable in mathematical equation or in computer program. The content of this tag is displayed in an italic format in most of the browsers.

HTML <var> Tag

This HTML var tag supports both the global and the event attributes.

Syntax: <var> Text </var>



Browser compatibility

The HTML var tag is supported by different types of browsers.

  • Chrome
  • Firefox
  • Opera
  • Safari
  • Internet Explorer

Example:

<!DOCTYPE html>
<html>
<body>
<var> This is a variable</var>
</body>
</html>

Output:

Variable

Tags that are supported by the <var> tag

Tag Description
em Renders as emphasized text
strong Specifies the important text
code Defines a piece of computer code
samp Specifies sample output from a computer program
kbd Specifies keyboard input
var Specifies a variable