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

259
Vistas
Track where specific style property was set from?

We can get style property of an element via getComputedStyle() but is there a way detect/track where this value was set from: user's CSS or system default or neither?

In this example only bakckground-color is set by user's stylesheet, display is set by "user agent stylesheet" (aka browser default) and width is not set by anything, it's automatically generated:

console.log("backgroundColor", getComputedStyle(test).backgroundColor);
console.log("display", getComputedStyle(test).display);
console.log("width", getComputedStyle(test).width);
#test
{
  background-color: lightblue;
}
<div id="test">test</div>

p.s. in DevTools there is a link to the stylesheet where the property is set:

enter image description here

and it shows which stylesheet sets the value:

enter image description here

about 4 years ago · Juan Pablo Isaza
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