HTML<var> tag

HTML <var> tag is a phrase tag which is used to define the variable for a mathematical equation, or in the programming context.

The content within <var> tag renders in italic font in most of the browsers, but it can be overridden using appropriate CSS.

Following are some related elements of <var> tag, which can also be used for the same context:

<code>: To determine the computer programming code.

<kbd>: To determine the keyboard input.

<samp>: To determine the sample output.

Syntax

<var>........</var>  

Following are some specifications about the HTML <var> tag

DisplayInline
Start tag/End tagStart and End tag
UsageFormatting

Example

<!DOCTYPE html>  

<html>  

<head>  

<title>HTML var tag</title>  

</head>  

<body>  

<h2>Example of var tag</h2>  

<p>Following is equation for distributive law</p>  

<p><var>a</var>(<var>b</var>+<var>c</var>)=<var>ab</var>+<var>ac</var></p>  

</body>  

</html>

Output:

HTML var tag

Attribute:

Tag-specific attributes:

The <var> tag does not contain any specific attribute in HTML.

Global attribute:

The <var> tag supports the Global attributes in HTML.

Event attribute:

The <var> tag supports the Event attributes in HTML.

Supporting Browsers

Elementchrome browser Chromeie browser IEfirefox browser Firefoxopera browser Operasafari browser Safari
<var>YesYesYesYesYes

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *