开发者

CSS - Code Generator Question

I develop in Chrome. And when I browser test, there are always some bugs in IE for which I need to make change to (or use conditionals) stylesheets.

I know php. Would it somehow be possible to write a script, to which I feed my Chrome-CSS-Working-Stylesheet and get back an IE-CSS-Working-Condit开发者_JAVA百科ional-Stylesheet?


LOL!

Um, sorry. :)

Now that would be a nice tool to have, wouldn't it?
Afraid that's a pipe dream though, you'll have to debug your CSS yourself.
It's not like Chrome speaks CSS dialect A and IE speaks CSS dialect B and both are 100% interchangeable, just with different syntax.

Experience and a lot of testing is the best tool for cross-browser compatibility.


If you repeatedly use the same or similar expressions in CSS for which you need to write conditional statements in IE, then it would be pretty easy to check for those few patterns in the CSS files using a simple script. Aside from that, the project would have to be a major undertaking and I agree with deceze.


I don't really think that is possible. A lot of what you would encounter has to do with the layout/HTML of the page as well. I'd recommend reading up on how to write your CSS/HTML in a way that avoids the box model issue so many people encounter. If you can understand that, then a lot of your layout issues can be handled pretty well.

ok, here are a few links on the box model and other common IE related bugs:

  • box model summary (read about it, but I don't recommend this method)
  • Good way to handle the box model w/o hacks
  • Some common IE CSS problems and fixes
  • Some more common IE CSS problems and fixes (Probably some overlap as the one above)


I suppose theoretically if you had a server side implementation of each render engine and fed it the page you could then to a diff on the computed style of each element and adjust using one of them as a designated "master".

But even then i think there might be instances where you get an unexpected result... or rather not exactly what you were looking for.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜