This article is a mirror article of machine translation, please click here to jump to the original article.

View: 10625|Reply: 0

[CSS/DIV] The var function of the CSS cascade style sheet

[Copy link]
Posted on 6/5/2020 11:47:51 AM | | | |
The var() function can replace any part of the value in any property in an element. var() function cannot be used as a property name, selector, or other value other than the property value.

grammar

The first parameter of the method is the name of the custom attribute to be replaced. The function's optional second parameter is used as a fallback value. If the custom property referenced by the first parameter is invalid, the function will use the second value.

The test code is as follows:


The renderings are as follows:



We define two class styles, .fsize can find the --font-size variable we defined, so it will display 20px, and .fsize2 cannot find the definition of --font-size-test, so it will use the second value of the function, which is 50px.

Note: Define the variable two dashes to start.

Reference:The hyperlink login is visible.




Previous:Angular 9 Series (V) formats the amount currency format
Next:Solved the issue where HttpContext.User.IsInRole() always returns false
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com