html - 将 CSS 类属性应用于 Firefox/IE 与 Chrome 中的链接元素

标签 html css internet-explorer firefox google-chrome

我在将类应用于 HTML 元素时遇到问题。它在 Chrome 中运行良好,但该类不适用于 Firefox/Opera/IE 的同一元素。

这是在 Chrome 中的样子:http://cl.ly/0W0P3t102U0p3J141w0u . 这是它在 Firefox 中的样子:http://cl.ly/1d0r2g3g3H2X1E0t2Q1x

不确定为什么没有在后面的“忘记”链接中应用该样式(既不是 float 样式也不是字体样式)。我检查了代码,似乎在后一种浏览器中呈现该类时没有被拾取。这是代码:

#login-form  .forgot, #login-form .forgot::active {
    font-size: 14px;
    float: right;
    line-height: 28px;
    position: relative;
    margin-right: 7px;
}
<div class="field">
  <p>
    <label for="user_password">Password</label>
    <input id="user_password" name="user[password]" size="30" type="password" />
    <br />
    <a href="pb-forgot-password_beta.htm" class="forgot">Forgot?</a>
    <span class="iferror"> &nbsp; </span>
  </p>
</div>

最佳答案

.forgot::active 中的双冒号(应该是 .forgot:active)可能导致解析错误,使浏览器忽略整个节。

关于html - 将 CSS 类属性应用于 Firefox/IE 与 Chrome 中的链接元素,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7237659/

相关文章:

html - Typescript,单击按钮时防止 Bootstrap Dropdown 关闭

javascript - 如何修复 else 语句未激活

javascript - JQuery 将项目添加到我的 JSON

javascript - 组织大列表结构和 jquery 以淡入元素

css - @font-face 在 IE 中带有模态窗口 : once in the modal font reverts back to Helvetica

javascript - 从另一个域加载脚本时,无法从 PHP 读取 Internet Explorer 中的 cookie

javascript - 更改 <li> 上的 z-Index

html - 导航溢出 15 英寸

javascript - 我怎样才能使动画的最终状态持续存在?

javascript - 链接.click();在 Chrome 中工作时无法在 Internet Explorer 中工作