让阴影文本在 IE 中工作

发布于 2024-11-06 10:01:40 字数 669 浏览 0 评论 0原文

在找到类似的问题后,我仍然遇到问题。这是我的 CSS:

        .title {
            position:absolute;
            bg-color:#FF0000;
            z-index:10;
            width:100%;
            height:100%;
            font-size:250%;
            color: #FCD116;
            text-shadow: 2px 2px 3px #555;
            filter: dropshadow(color=#555, offx=1, offy=1);
            zoom:1
        }

在 Google Chrome 中,阴影仅偏移约 2 个像素。这正是我想要的。然而,在 IE 中,阴影非常远(相对于我想要的)并且很粗。我已将 offx 和 offy 设置为 1。为什么这不起作用?我以前从未使用过这种方法,我现在在查看带有我的标题的SO建议时发现了它。

作为旁注

当我问时,有人知道如何让 IE 让我做透明图像吗?我尝试放置半透明图像(带有阴影的按钮),但阴影是深黑色的,看起来质量受到了影响。我会为这个问题奖励积分(如果回答的话):)

After finding a similar question on SO, I still am having problems. Here is my CSS:

        .title {
            position:absolute;
            bg-color:#FF0000;
            z-index:10;
            width:100%;
            height:100%;
            font-size:250%;
            color: #FCD116;
            text-shadow: 2px 2px 3px #555;
            filter: dropshadow(color=#555, offx=1, offy=1);
            zoom:1
        }

In Google Chrome, the shadow is only offset by about 2 pixels. This is exactly what I want. In IE, however, the shadows are super far away (relative to what I want) and chunky. I've set the offx and offy to one. Why isn't this working? I've never used this method before, I just found it now while looking at the suggestions on SO with my title.

AS A SIDE NOTE

While I am asking, does anybody know how to get IE to let me do transparent images? I tried to put a semi transparent image (a button with a drop shadow) but the shadow is dark black and it gives the appearance that the quality has been compromised. I'll award points for this question (if answered) :)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

只是偏爱你 2024-11-13 10:01:40

主要问题 - 您需要在过滤器内使用完整的 6 字符十六进制值 - 即 #555555。

附带问题 - 就我个人而言,我发现 Drew Diller 的 belated_png 脚本 是一个快速可靠的解决方案。放入脚本中,并将 png_bg 类应用于您想要具有 Alpha 透明度的任何内容。

PS - http://jsfiddle.net/peXwY/

.title {
    position:absolute;
    bg-color:#FF0000;
    z-index:10;
    width:100%;
    height:100%;
    font-size:250%;
    color: #FCD116;
    text-shadow: 2px 2px 3px #555;
    Filter: DropShadow(Color=#555555, OffX=2, OffY=2, Positive=1);
    zoom:1
}

Main issue - you need to use a full 6-character HEX value - i.e. #555555 - inside the filter.

Side issue - personally I've found Drew Diller's belated_png script to be a quick and reliable solution. Drop in the script, and apply a png_bg class to anything you want to have alpha transparency.

PS - http://jsfiddle.net/peXwY/

.title {
    position:absolute;
    bg-color:#FF0000;
    z-index:10;
    width:100%;
    height:100%;
    font-size:250%;
    color: #FCD116;
    text-shadow: 2px 2px 3px #555;
    Filter: DropShadow(Color=#555555, OffX=2, OffY=2, Positive=1);
    zoom:1
}
不再见 2024-11-13 10:01:40

这里有一些很好的信息供您旁注...另外,请查看底部的“sleight”参考:http://24ways.org/2007/supersleight-transparent-png-in-ie6

至于主要问题,考虑弄乱 .title 的 z-index。我记得几个月前在 IE 中遇到了问题,这是因为 IE 在页面上排序垂直对象的方式。

Here's some good information for your side note... Also, take a look at the "sleight" reference towards the bottom: http://24ways.org/2007/supersleight-transparent-png-in-ie6

As for the main issue, considering messing with the z-index of .title. I recall having issues with it in IE several months ago, and it was because of the way IE was ordering the vertical objects on the page.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文