Let's say we have a list of classes storing background colors.
.bgr-red //background-color: rgb(255, 0, 0);
.bgr-green //background-color: rgb(0, 0 , 255);
.bgr-blue //background-color: rgb(0, 128, 0);
And we have a div using one of these classes.
<div class="bgr-red">...</div>
Is there any way that I can create a new set of classes which contain alpha channels? Something like this (I tried this method, it didn't work):
.alpha-90 //background-color: rgba(inherit, inherit, inherit, .9);
.alpha-80 //background-color: rgba(inherit, inherit, inherit, .8);
.alpha-70 //background-color: rgba(inherit, inherit, inherit, .7);
The end objective being to be able to place background color opacity into a div separate from the rest of the background color value? Creative a div something like this:
<div class="bgr-red alpha-80">...</div>
Thank you.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…