From the course: Controlling CSS with JavaScript

Unlock this course with a free trial

Join today to access over 24,000 courses taught by industry experts.

Access rules from a style sheet

Access rules from a style sheet

- The style sheet lists interface gives you deep, granular access to everything that's happening inside each style sheet that's applied to a document. So in this movie, we'll go through this and I'll show you how you can really dig in and find exactly the property and property value and everything else you're looking for, through this interface. So let's start by just seeing what is being output here. You'll remember we are querying all the style sheets and then finding this one style sheet called extra dot CSS. And we are currently just outputting that entire style sheet. In the browser, I can expand the output here and make this a little bit bigger so you can really see what's going on. And you see, we have a property called CSS rules, the CSS rules property then outputs each of the rules. So here we have two rules, animals, L I A, and animals, L I A hover. And for each of these rules, we can then further…

Contents