【问题标题】:Form CSS input:hover and input:focus not working in IE表单 CSS 输入:悬停和输入:焦点在 IE 中不起作用
【发布时间】:2011-11-17 11:05:50
【问题描述】:

我在这个页面上使用了 input:hover 和 input:focus 的 CSS 样式:

Lenticular Printing and 3D Promotional Products

效果在 Chrome 和 Firefox 中有效,但在 IE 中无效。我做错了什么?

【问题讨论】:

    标签: css internet-explorer internet-explorer-8 focus hover


    【解决方案1】:

    如果您在使用 IE9 时在本地计算机(或 Intranet 站点)上没有看到焦点颜色充电,请使用 Tools >> Compatibility View Settings,并禁用 Compatability 复选框。

    这将覆盖浏览器级别的设置,与网站代码无关。

    【讨论】:

      【解决方案2】:

      :focus

      【讨论】:

        【解决方案3】:

        检查 html 文档是否有效,因为 Internet Explorer 可能处于 quirks 模式,为此请确保您的文档有效,并检查 html 文档标题:

        <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
        <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
        

        【讨论】:

        • 该页面没有文档类型!很好的收获。
        • 该页面确实没有doctype,但是当我添加一个时,该页面在IE9中显示为一堆灰色条。也许这是 Volusion 代码的问题?
        • 灰条?听起来像:“IE-break-the-CSS-rules”相关的东西。
        猜你喜欢
        • 2021-09-13
        • 1970-01-01
        • 1970-01-01
        • 2012-06-19
        • 2013-01-19
        • 1970-01-01
        • 1970-01-01
        • 2019-03-26
        相关资源
        最近更新 更多