CSS依赖于ActiveX? [英] CSS dependent on ActiveX?

查看:176
本文介绍了CSS依赖于ActiveX?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



[link removed]

我已经在FF,Chrome,Safari甚至是IE8 ... / p>

为了得到在IE8工作的CSS3功能(旋转,不透明度,文本阴影),我不得不使用ActiveX过滤器。我的问题是,当你第一次去网站,它弹出一个横幅在顶部,用户必须单击,然后单击允许,然后单击确定。我不认为大多数IE用户都会这样做。



所以我想使IE8中的默认布局(在ActiveX之前)移动标题(我的名字),给它一个纯色的背景。然而,如果我添加这些样式,它使页面看起来不好,如果用户启用ActiveX。



我似乎没有想到一个CSS解决方法,任何人都有什么想法?



谢谢!
Jeff



编辑:为了澄清,我不是想在IE8中没有过滤器的旋转,opactiy等工作。请参阅对Olafur的回应...

解决方案

首先,好消息:


$我的问题是,当你第一次去网站,它弹出一个横幅在顶部,用户必须单击,然后单击允许,然后单击确定。我不认为大多数IE用户都会这样做。


大多数IE用户不必这样做,因为运行ActiveX控件和插件的默认安全设置为已启用。我怀疑你看到它,因为你或你的网络管理员有意在您的安装上锁定ActiveX。



现在坏消息 - 我不知道会有以任何方式测试ActiveX,而不会触发警告消息的人没有启用默认情况下。但是,如果你可以为它做一个可靠的测试(不知道如何确切,但一些变化应用过滤器,然后检查它是否应用应该工作),应用样式应该比较容易与一点JavaScript。



以正常方式为您的网页声明默认规则,而不会产生任何轮播,不透明度或文字阴影:

  h1 {...} 
p {...}

你的例程来检测ActiveX是否被支持,如果它是动态添加一个类到body元素如 ax-en 。同时在你的样式表中你有这样的规则:

  .ax-en h1 {/ * -ms-过滤器东西和相关规则* /} 
.ax-en p {/ * -ms过滤器和相关规则* /}

这基本上是 modernizr.js 使用的方法,读取了本文对一般策略的更长解释。


I've got my page working in FF, Chrome, Safari, and even IE8... as long as ActiveX is enabled.

[link removed]

To get the CSS3 features (rotation, opacity, text-shadow) working in IE8, I had to use ActiveX filters. My problem with this is that when you first go to the site, it pops up with a banner at the top, which users have to click, then click Allow, then click OK. I don't think most IE users are going to do this.

So I'd like to make the default layout in IE8 (before ActiveX) look decent by moving the header (my name) down and giving it a solid-color background. However if I add these styles, it makes the page look bad if the user DOES enable ActiveX.

I can't seem to think of a CSS workaround for this, does anyone have any ideas?

Thanks! Jeff

EDIT: To clarify, I'm not trying to get rotation, opactiy, etc. working in IE8 without filters. See response to Olafur for clarification...

解决方案

So first, the good news:

My problem with this is that when you first go to the site, it pops up with a banner at the top, which users have to click, then click Allow, then click OK. I don't think most IE users are going to do this.

Most IE users won't have to do this, because in the default security settings for 'Run ActiveX controls and plug-ins' is 'Enabled'. I suspect you are seeing it because either you or your network administrator has purposely locked down ActiveX on your installation.

Now the bad news - I'm not sure there's going to be any way to test for ActiveX without triggering the warning message for people who haven't got it enabled by default. However, if you can work out a reliable test for it (don't know how exactly, but some variation of applying a filter then checking to see if it applied should work), applying the styles ought to be relatively easy with a bit of JavaScript.

Declare your default rules for your page without any rotation, opacity or text shadow in the normal way:

h1 {...}
p {...}

On page load run your routine to detect whether ActiveX is supported, if it is dynamically add a class to the body element such as ax-en. Meanwhile in your stylesheet you have rules like this:

.ax-en h1 { /* -ms-filter stuff and associated rules */ }
.ax-en p { /* -ms-filter stuff and associated rules */ }

This is basically the approach used by modernizr.js, have a read of this article for a longer explanation of the general strategy.

这篇关于CSS依赖于ActiveX?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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