gpt4 book ai didi

css - SASS:将 RGB 转换为 RGBa

转载 作者:技术小花猫 更新时间:2023-10-29 10:55:31 25 4
gpt4 key购买 nike

我已经像这样设置了我的元素的颜色:

$blue: rgb(75, 179, 209);

有什么方法可以使用这个变量,并根据需要在其他地方将值转换为RGBa吗?

最佳答案

使用 rgba instance method

你可以

$blue: rgb(75, 179, 209);

body {
background:rgba($blue, .5);
}

可以在这里测试:http://sass-lang.com/try.html

关于css - SASS:将 RGB 转换为 RGBa,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14629260/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com