Answers for "how to adjust the opacity color in variable css"

CSS
2

add alpha value to css color variable

:root {
  /* #f0f0f0 in decimal RGB */
  --color: 240, 240, 240;
}

body {
  color: #000;
  background-color: #000;
}

#element {
  background-color: rgba(var(--color), 0.8);
}
Posted by: Guest on July-16-2021
4

background color with opacity

h1 {background-color:rgba(255,0,0,0.3);}
Posted by: Guest on April-01-2020

Browse Popular Code Answers by Language