Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

253
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda