tags:

views:

60

answers:

3

I'm cleaning up the CSS on a fairly large (and somewhat disorganized) website. Is there a simple way (or a piece of software) that will let me find, for example, all the "a" tags that are within "h3" tags? Or all the "spans" that are within "p" tags? I want to modify some of these CSS rules but I'm afraid I'll break something hidden somewhere. Any advice?

A: 

You're definitely going to want to take a look at FireBug and XPathChecker, two excellent Firefox extensions.

John Feminella
I do use firefox but I just looked into it further and discovered the command line API - thanks! But as far as I can tell this only works on a single page at a time. Is there a way to make it search an entire site (ie, recursive folders)?
A: 

If you're looking to clean up the CSS on a website, I highly suggest the Firefox plugin Dust-Me Selectors, which is specifically designed to scan websites for CSS that is going unused. It can even scan multiple pages at a time, either by having it automatically spider your website or by providing it a sitemap file of the specific pages you want checked.

Daniel Lew
+1  A: 

You could just modify your CSS to highlight the elements you are looking for. For example

h3 a { background-color: red }

will highlight all the "a" tags that are within "h3" tags.

Angel Chiang