Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

257
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!