In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)05/31 Report--
This article introduces the relevant knowledge of "whether variables can be defined in css". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
Variables can be defined in css. The syntax of the variable definition is "--variable name", and the variable name defined in css is case-sensitive; the var () function can be used to read the variable with the syntax "var (--variable name)", and the second parameter of the function can be used to represent the default value of the variable, which will be used if the variable does not exist.
The operating environment of this tutorial: windows10 system, CSS3&&HTML5 version, Dell G3 computer.
Can variables be defined in css?
Variables can be used in css.
When you declare a css variable, the variable name is preceded by two hyphens (- -). Variable names are case-sensitive,-- header-color and-- Header-Color are two different variables.
The var () function is used to read variables.
The var () function can also take the second argument, which represents the default value of the variable. If the variable does not exist, this default value is used.
The second parameter does not handle internal commas or spaces and is treated as part of the parameter.
Examples of variables used by css:
: root {--base: yellow;-- spacing: 10px;-- blur: 10px;}
The above code defines three variables: root makes it accessible to everyone
Img {filter: blur (var (--blur)); padding: var (--spacing); background: var (--base);}
The above uses the previously defined variable as the attribute value.
That's all for the content of "whether variables can be defined in css". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.