开发者

How do I filter unwanted CS styles from CS sheet?

I have a web 2 template with external css sheets. I want to change it layouts but keep texts/button styles/and some portion of the layouts. the main problem I am facing is finding out which are the classes I need to keep in css file and which are them to delete it. actually the style sheets has got lots of classes def开发者_Go百科ined in it.

how do I remove unwanted classes and id's from style sheet?? is there a better way rather than physically going through each classes and comparing it with web page source code?

I am using Adobe dreamweaver CS5 for web design.


You can try Dust Me Selectors FF plugin, which will do the work for you.

You can also google for more. Ie. this post


If I were in your situtation, I'd use Firebug addon for Firefox. Open the page and inspect the button elements whose styles you want to keep and note which CSS rules are applying to them. Keep these rules and remove the other classes and styles.

Firebug is great because it can tell you exactly which rules are applying to an element, which if you are just looking at the CSS markup itself, may be very difficult to discern.


Use Dust-Me Selectors


Dust-Me Selectors is a Firefox extension (for v1.5 or later) that finds unused CSS selectors.

It extracts all the selectors from all the stylesheets on the page you're viewing, then analyzes that page to see which of those selectors are not used. The data is then stored so that when testing subsequent pages, selectors can be crossed off the list as they're encountered.

You can test pages individually, or spider an entire site, and you'll end up with a profile of which selectors are not used anywhere.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜