(How can I help create an) Automated solution for finding CSS conflicts?
Is there an automated tool that I can use to find and possibly resolve CSS conflicts? Preferably it would be either PHP or a command line utility so I can put it into the script that combines and minifies my CSS files. Also acceptable would be a javascript application suited for the task.
If this doesn't exist (I haven't been able to find anything), then why not? It seems like it would be an interesting project, what out-of-the-ordinary challenges开发者_StackOverflow社区 would I be facing? Does anyone have any advice or recommendations on where to start?
I have 2 classes left in my CS BS, and I've been coding at work for a few years now so I'm reasonably confident in my ability to make some decent progress on this. Feel free to send me to any resources you think will be helpful.
Thanks for your help!
PS: Also you can suggest features. One driving force in this is my desire to be able to take a CSS file & an HTML file and inline all the CSS into the HTML elements. It's an email thing.
Check out CSSTidy:
CSSTidy is an opensource CSS parser and optimiser...in opposite to most other CSS parsers, no regular expressions are used and thus CSSTidy has full CSS2 support and a higher reliability.
Regarding the "email thing" you can use Premailer, it's similar to what you want.
For the best HTML e-mail delivery results, CSS should be inline. This is a huge pain and a simple newsletter becomes un-managable very quickly. This script is our solution.
to resolve css conflicts.. use inspect element on chrome or firebug on firefox.. it displays the css that is being applied on the current element which u select.. You can see the styles being applied, inherited, cancelled by a certain element.
精彩评论