【问题标题】:IE-only text field background image仅限 IE 的文本字段背景图像
【发布时间】:2011-06-01 23:00:46
【问题描述】:

我正在尝试修复我的 CSS 以允许旧版 IE 尽可能最好地查看我的网站。

我正在使用“border-radius”来设置表单域的样式,并赋予它们圆角。对于较旧的 IE,我使用下面的背景图片--

http://studio.allanbendy.com/sites/all/themes/studio_allanbendy_7/i/form-textfield-bg.gif

.form-textfield {
background: url("/i/form-textfield-bg.gif") no-repeat bottom right;
background-attachment: fixed;
height: 15px;
width: 362px;
}

不幸的是,上面的 CSS 似乎没有为 IE 7 和 8 上的文本字段设置样式。它在 IE 6 上工作得很好。

有什么建议吗?

【问题讨论】:

    标签: css internet-explorer-8 internet-explorer-7 internet-explorer-6


    【解决方案1】:

    删除background-attachment: fixed;。因为 IE6 对不可滚动的元素忽略了这一点,所以它会显示在那里。但是,如果您想为单个元素设置样式,那么附件定义根本没有意义。

    【讨论】:

      【解决方案2】:

      我建议使用CSS3Pie 在 IE 中做圆角,而不是 IE 特定的图形。

      让 IE 支持标准 CSS border-radius 样式是一个很好的解决方案。

      【讨论】:

      • 谢谢,我考虑过了,但是对于一些表单元素,不需要加载另一个js文件。
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-05-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-10-08
      相关资源
      最近更新 更多