内联CSS IE黑客 [英] In-line CSS IE hack
本文介绍了内联CSS IE黑客的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
例如,在使用行内CSS时是否可以创建盒子模型?
Is it possible to create, for instance, a box model hack while using in-line CSS?
例如:
< div id =blahstyle =padding:5px; margin:5px; width:30px; / * IE5-6等同于此处* />
谢谢!
推荐答案
您可以在内联样式中使用前缀黑客:
You can use the "prefixing" hack in inline styles as well:
<div style="*background:red"></div>
只需确保将IE hack放在style属性的末尾。然而,我第二个意见,应该尽可能避免内联样式。条件注释和Internet Explorer的单独的CSS文件似乎是处理此类问题的最佳方式。
Just make sure you put the IE hacks at the end of the style attribute. However I second the opinion that inline styles should be avoided when possible. Conditional comments and a separate CSS file for Internet Explorer seem to be the best way to handle such issues.
这篇关于内联CSS IE黑客的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文