IE 中的文本阴影,替代方案
我需要在 IE 中为内联长段落文本提供文本阴影。我理解渐进增强,但情况有所不同。我确实需要文本阴影,这不是设计问题,而是我的应用程序功能的核心问题。
无论如何,IE 不支持 CSS text-shadow。有哪些替代方案?我知道某些字体的轮廓可以产生与文本阴影类似的效果,但 IE 是否支持网络不安全字体?
动态图像替换怎么样?这是一个可行的策略吗?考虑到文本的长度,我想可能不会。
有人有什么建议吗?我也考虑过强制使用谷歌浏览器框架,但如果没有其他可行的策略,这就是最后的手段。
谢谢。
I have a need for text-shadow for inline, long, paragraph text in IE. I understand progressive enhancement, but the situation is different. I do absolutely need text-shadow, it's not a design issue, but a matter central to the function of my app.
In any case, IE does not support CSS text-shadow. What are some alternatives? I know that some fonts have outlines that creates a similar effect as text-shadows, but does IE support web-unsafe fonts?
What about dynamic image replacement? Is that a viable tactic? I'm thinking probably not, considering the length of the text.
Does anyone have any suggestions? I've also considered forcing google chrome frame, but that's sort of a last resort thing if there are no other viable strategies.
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我认为你应该使用 true type font(.ttf) 字体并将其转换为 .eot。然后通过 java 脚本在 html 中引用它,如下所示:
然后在实际的 html 中,在 style 属性中引用字体,如下所示:
您可以在此处将 .ttf 转换为 .eot,并找到有关其工作原理的进一步说明 http:// www.kirsle.net/wizards/ttf2eot.cgi
I think you should use a true type font(.ttf) font and convert it to .eot. Then referance it in your html via java script likes this:
Then in your actual html you make reference to the font in the style attribute like this:
You can convert from .ttf to .eot here and find further explaination on how it workd http://www.kirsle.net/wizards/ttf2eot.cgi
我认为,就你的核心需求而言,Flash是你最好的选择。我不确定 SIFR 是否支持阴影,但这值得研究。
与强制 Chrome 框架相比,这对用户来说无疑是更便宜的负担。
编辑:
看起来 SIFR 在这方面非常灵活:
http://fortysevenmedia.com/blog/archives /sifr_3_hard_drop_shadows/
更有希望,除非我弄错了,否则看起来 IE 可能支持它:
http://msdn.microsoft.com/en-us/library/ms533086%28VS.85%29.aspx
所以:
I think that here, with your core requirements, Flash is your best best. I'm not sure if SIFR supports shadow, but that's worth looking into.
It's certainly a cheaper burden on your users than forcing Chrome frame.
EDIT:
Looks like SIFR is quite flexible on this front:
http://fortysevenmedia.com/blog/archives/sifr_3_hard_drop_shadows/
Even more promising, unless I'm mistaken, it looks like it may be supported in IE:
http://msdn.microsoft.com/en-us/library/ms533086%28VS.85%29.aspx
so:
我刚刚在 IE 中将其用于文本阴影:
我唯一关心的是,如果用户更改了 PC 上的文本渲染,现在它会变得非常漂亮。如果我不将文本加粗,我的效果还可以,但一旦我这样做,它就会变得块状。
我可能只是在 IE 中留下文本阴影,但多么 S**!那是……哈哈
I have just used this for text-shadow in IE:
My only concern with this is that if the user has changed their text rendering on their PC it will now be so pretty. Mine has turned out okay if I don't bold the text, but as soon as I do it goes blocky.
I may just leave the text shadow in IE but how S**! is that... lol