在线CSS压缩不会删除IE hacks [英] Online CSS compress which doesn't remove IE hacks

查看:89
本文介绍了在线CSS压缩不会删除IE hacks的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有在线CSS压缩器无法删除任何CSS浏览器黑客。

Are there are CSS compressors online which do not remove any of the CSS browser hacks.

例如:使用: cleancss.com 可以使没什么不同,我设置的选项将始终删除 * display 用于IE显示的内联块黑客。

E.g: Using: cleancss.com it makes no difference which options I set it will always remove the *display for IE display inline-block hack.

a {
    border-radius:5px
    display: inline-block;
    *display: inline;
    zoom: 1;
    text-shadow: 0 2px 3px rgba(0,0,0,0.4);
    -moz-border-radius:5px;-webkit-border-radius:5px;
}


推荐答案

CSS压缩器清洁CSS 通常对我有用,尽管我更喜欢对Internet Explorer的所有先前版本使用不同的样式表。通常最好分开保留以前的浏览器对CSS的支持。或将骇客文件保存在单独的文件中,并将其附加到压缩的CSS中。

CSS Compressor and Clean CSS usually work for me, although I prefer to use a different stylesheet for all previous versions of internet explorer. It is usually better to keep previous browser supporting css seprately. Or keep hacks in a seprate file and appened it to the compressed css.

但是,在您的情况下,压缩程序确实删除了 *

In your case, however, the compressors do remove *

我不知道有任何在线压缩程序可以保存这些hack,但是,我可以提供解决方法。

I do not know any online compressors which preserve the hacks, however, I can offer workarounds.

一种解决方案是在选择器而不是属性上使用技巧。
以下是几个示例:

A solution would be to use hacks on selector rather than on attribute. Here are a couple of examples :

* html #uno  { color: red } /*IE6 and below*/
*+html #dos { color: red }  /*IE7*/

在此处查看有关其他可用黑客的信息: http:// paulirish。 com / 2009 / browser-specific-css-hacks /

Check here about the other hacks available : http://paulirish.com/2009/browser-specific-css-hacks/

如果这对您不起作用,则可能会有点累,但是在压缩之前,在

If that does not work for you another workaround, might be a little tiresome, but before compression, add some unique value before a hack like

#uno {#HACK#display:inline;}

,然后使用文本编辑器压缩后,替换所有#HACK# *

and then after compression using a text editor replace all #HACK# with *

这篇关于在线CSS压缩不会删除IE hacks的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆