Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Find definition of CSS class in external stylesheet

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?

like image 560
tronman Avatar asked May 28 '14 18:05

tronman


People also ask

How do I know my CSS 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).

Can you define a class in CSS?

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.

How do you style a class in external 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.


1 Answers

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.

enter image description here

like image 96
Dylan Avatar answered Sep 19 '22 15:09

Dylan