Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to find which CSS files are used for current page [duplicate]

Tags:

html

browser

css

I have a lot of CSS files on the page. But a lot of these files are not used by styles. Is it possible to determine which files are used by page and which not.

like image 531
Sergey Avatar asked Oct 13 '11 08:10

Sergey


People also ask

How to find or access CSS files for current page?

3) If you use google chrome,then u can directly use Inspect Element option by right clicking on page. Show activity on this post. The way to find or access to CSS files are used for current page, could vary base on the Browser and/or Operating system you are using.

How do I find the CSS name of an image?

When you open the Console of the current browser, click on the element you want to inspect and on the right hand side you will have a tab name Styles as shows below: As you can see the image has the name of the CSS file (in this example named "desktop_ltr.css")

How to check for unused CSS in Google Chrome?

Google Chrome has a two ways to check for unused CSS. 1. Audit Tab: > Right Click + Inspect Element on the page, find the "Audit" tab, and run the audit, making sure "Web Page Performance" is checked.

Can I delete CSS files that are not used on websites?

Now you can remove those CSS files that are not used on that web page. Thanks. Show activity on this post. New in Chrome 59 is the coverage tool that shows you CSS and JS code coverage.


2 Answers

Use http://getfirebug.com/ to debug the page.

When looking at the css it will reference which stylesheet is used.

For example:

You can see from the screenshot that when using Firebug it shows in the blue text that the page is using the style.css stylesheet.

enter image description here

Work down the tree in Firebug and simply hover over your elements and see which stylesheets are used.

like image 88
Rob Avatar answered Sep 28 '22 09:09

Rob


You can debug with firebug ( http://getfirebug.com/ ). It will show what is used for what and allows you to find out.

like image 23
JNDPNT Avatar answered Sep 28 '22 10:09

JNDPNT