Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

258
Visualizações
How can I set a variable In HTML for RGBA?


In my HTML code, there is a repetition of using the same, RGB values, in testing, I am changing the colors frequently, so I was hoping there is a way to have the RGB value set or defined somewhere.

I want to stress that, I don't want the ALPHA value set in the RGBA.

For example:

var COLOR = 189,28,50 <br>
...<br>
fill="rgba(COLOR,0.7

This is my Code

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

A simple answer would be using CSS Custom Properties (Variables) which is very easy and straightforward technique. Declaring a custom property is done using a (custom property name) begins with a double hyphen (--), and then a property value which is any valid CSS value like black, yellow, . Like any other property, this is written inside a ruleset, so it is a set of rules that needs to be written in the style.css file. then step 2 would be defining these custom property inside your :root pseudo-class, so that it can be applied for global usage across your entire html doc. Hope you got the answer. HTML file CSS file

Mozilla Documentation Link: https://developer.mozilla.org/en-US/docs/Web/CSS/Using_CSS_custom_properties

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda