首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >IE的实验CSS :黑客还是不黑客?

IE的实验CSS :黑客还是不黑客?
EN

Stack Overflow用户
提问于 2010-08-13 06:15:42
回答 6查看 418关注 0票数 2

有一些眼睛糖果实验CSS,如边界半径(圆角)和梯度,我希望使用在我的网页。不幸的是,Internet还不支持这些。至少边界半径正在IE9上出现,还没有关于渐变的词.

所以,你会建议不要让IE单独使用(我的大多数用户无论如何都会在FF或Chrome上)还是使用图像来“修复”IE的演示文稿?值得吗?因为我知道,这不仅是一个痛苦的背后,但也可能打破样式在其他浏览器。

那么,是黑还是不黑?

EN

回答 6

Stack Overflow用户

回答已采纳

发布于 2010-08-13 12:50:40

如果您不想要图片、IE黑客或单独的样式表,您可以始终查看CSS3Pie:http://css3pie.com/。它并不完美,尤其是当你想要一些渐变和阴影,但它可以很容易地处理圆角。有类似的IE行为,但我认为这是目前最积极的发展。

票数 1
EN

Stack Overflow用户

发布于 2010-08-13 06:20:08

虽然这个问题有点主观,但我的答案是不要黑。CSS3是向后兼容的,这意味着如果浏览器不支持它,它就会优雅地退化。对我来说应该是这样。我的意思是,如果你仍然打算破解CSS3,为什么还要使用它呢?在这种情况下,只需使用简单的老式CSS2技巧,比如javascript、圆角或图像,这样您就不必自己黑了。

票数 2
EN

Stack Overflow用户

发布于 2010-08-13 13:14:30

术语小问题:使用图像模仿IE中的CSS3特性并不是真正的黑客行为。任何在CSS中不直接支持的视觉效果都需要在图像中实现。

但要回答你的问题,这取决于:

  • 如果很少的观众使用IE,那么你可以忽略它。找出那么少是足够少是取决于你/网站所有者。
  • 若否,则:
代码语言:javascript
复制
- If the `border-radius` effects aren’t a key part of the site’s branding, then I’d suggest you just let IE ignore them and use square corners. No-one browses the web with two browsers simultaneously, and no-one cares if your site looks a little bit different in IE 6, as long as the buttons are in the same place and everything works.
- If they are a key part of the site’s branding, or your client insists on the site looking the same in IE 6, then you’ve got to achieve the look in IE 6. So, either:
代码语言:javascript
复制
    - use `border-radius`, and use [conditional comments](http://www.quirksmode.org/css/condcom.html) to include a stylesheet for IE 8 and below with code to imitate the features
    - don’t bother with `border-radius` — use the code that works in IE for all browsers. This will avoid you having to maintain two sets of code, but it will mean that all browsers have to download the images you’re using for IE, thus making them perform slightly less well.

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/3474339

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档