The CSS variables are just like simple variable of any programming language. These variables are used to store values and have a scope in which the variables can be used. A variable is defined by using two dashes(–) at the beginning and then the name which is case-sensitive. The benefit of variables is that it allows the same values to be reused at multiple places and updated/modified from one place. Also, the variable names are easier to understand and use, compared to the values of colors.
var( --custom-name, value )
Parameters: The variable var() accepts two parameters which are listed below:
- –custom-name It is a required parameter which accepts the custom property name.
- value: It is an optional parameter. It accepts fallback value which is used when custom property is invalid.
Supported Browsers: The browser supported by CSS variables are listed below:
- Google Chrome 49.0
- Internet Explorer 15.0
- Firefox 31.0
- Safari 9.1
- opera 36.0
- Python Variables
- Variables in TypeScript
- How to pass PHP Variables by reference ?
- PHP | $_FILES Array (HTTP File Upload variables)
- How to download Google Images using Python
- Important Tips on How To Prepare for the GRE
- id command in Linux with examples
- How to set alternate table row color using CSS?
- ipcrm command in Linux with examples
- Compiling with g++
- How to check form submission in PHP ?
- Console.SetWindowSize() Method in C#
- HTML | DOM Option value Property
- Console.ReadLine() Method in C#
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.