I'm using Chrome's Development Tools to inspect an element from a web page. Suppose it shows something like:
<div class="some-class">
Assuming some-class
is defined in an external style sheet, what is the simplest way to find the style sheet(s) that define some-class
?
To do this, start with the element name, then write the period (.) character, followed by the name of the class (look at Example 1 below). HTML elements can also refer to more than one class (look at Example 2 below).
What is a CSS class? A CSS class is an attribute used to define a group of HTML elements in order to apply unique styling and formatting to those elements with CSS.
It is needed to stylize HTML elements – including changing colors, fonts, or the size of a text. If you want to use a class, use a full stop (.) followed by the class name in a style block. Next, use a bracket called a declaration block that contains the property to stylize the element, such as text color or text size.
If you're using the Chrome inspector (right click page, inspect element), highlight the line and look to the right. It should show the CSS class and any rules that are used, and a link to the CSS file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With