Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

How to define a variable in HTML5 ?

  • Last Updated : 05 Jun, 2020

In this article, we define a variable in the HTML by using the <var> tag in the document. It is a phrase tag and used to specify the variable in a mathematical equation or in the computer program. The content of this tag is displayed in an italic format in most of the browsers.


<var> Contents... </var>


<!DOCTYPE html>
        How to define a
        variable in HTML5?
        body {
            text-align: center;
        .gfg {
            font-size: 40px;
            font-weight: bold;
            color: green;
        .geeks {
            font-size: 25px;
            font-weight: bold;
    <div class="gfg">GeeksForGeeks</div>
            HTML5: How to define a variable?
    <var>GeeksforGeeks Variable</var>


Supported Browsers are listed below:

  • Google Chrome
  • Internet Explorer
  • Firefox
  • Opera
  • Safari

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!