如--co1为 #ff3366, 这个值是后台设置的, 有且仅有一个全局颜色这样使用没问题: background: var(--co1)
现在有一个块要设置半透明: #ff336655 怎么设置呢(不能用js)
background: var(--co1)"55" //无效background: calc(var(--co1)"55") //无效
<html> <head> <title>option chain</title> <meta charset="utf-8" /> <style> body { --x: 255, 0 ,0; } div { height: 100px; } div:nth-of-type(1) { background-color: rgb(var(--x)); } div:nth-of-type(2) { background-color: rgba(var(--x), .5); } </style> </head> <body> <div></div> <div></div> </body> </html>
2.1m questions
2.1m answers
63 comments
56.7k users