Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add a new CSS class in Chrome developer tool

Is it possible to add a whole new CSS class like this in Chrome dev tools?

.myclass {
    background-color: yellow;
}
like image 274
PerrierCitror Avatar asked Jul 29 '17 06:07

PerrierCitror


People also ask

Where can I find CSS in developer tools?

On Chrome's Developer Tools tab (CTRL + SHIFT + I), go to Resources (you may have to enable Resource tracking on that page), and click on the sub-tab Stylesheets. That will show all css files loaded by that page.


1 Answers

On the Elements tab there's a styles tab which contains a small + button on the right side.

New Style Rule

When you click here, you can add a whole new CSS class.

enter image description here

Once you've defined the new class, see Add a class to an element to learn how to apply it to an element. You could also just double-click the element in the DOM Tree on the Elements panel to add or edit the element's class attribute.

like image 114
Tom Van Rompaey Avatar answered Oct 17 '22 05:10

Tom Van Rompaey