【问题标题】:Firefox is acting weird on this formFirefox 在这个表单上表现得很奇怪
【发布时间】:2010-08-17 05:39:22
【问题描述】:

我正在尝试将<button> 浮动到右侧。 <button><form> 之外,但在同一行。由于某种原因,这在 FF 中不起作用。我将表单背景设为红色,发现 <button> 仍在 FF 中的 <form> 中,尽管它不是!其他所有浏览器都可以正常工作,<button> 不在<form> 中。

屏幕截图:(左边是chrome...带有http://的那个,右边是Firefox

alt text http://img375.imageshack.us/img375/3824/ffchrome.png

HTML:

<form>
  <input type="url" placeholder="http://" />
  <input type="submit" value="Crypt" />
</form>
  <button type="button"> ? </button>

CSS:(去掉了不必要的代码)

section.crypter {
  padding: 25px;  
  }
section.crypter form {
  display: block;
  float: left;
  background: red;
}
/* Input */
section.crypter input[type="url"] {
  border:1px solid #666;
  color: #939393;
  font: italic bold 1.7em Verdana, Arial, Serif;
  outline: 0;
  padding: 10px 10px;
  width: 240px;
  }
section.crypter input[type="submit"] {
  border:1px solid #666;
  color: #000;
  font: 2em Verdana, Arial, Serif;
  margin:0 0 0 -10px;
  padding: 8px 20px;
  }

section.crypter input[type="submit"]::-moz-focus-inner {
  border: 0;/* Firefox hack */
  }
section.crypter button {
  display: block;
  float: right;
  padding: 10px 25px;
  }

【问题讨论】:

  • 没有你的 CSS 很难说。
  • 刚接触编码才几个月,我不知道 Firefox 有这些问题。 :/ 认为 IE 是坏人。
  • 向我们展示 CSS + 什么版本的 Firefox?你测试过多个版本吗?不要这么快责怪 Firefox,你可能不是以“最佳实践”的方式来做这件事的。
  • @Kawohi,CSS 规范中存在足够多的歧义,以至于浏览器可以显示不同的内容而不会成为“坏人”。 IE 以违反规范着称,但仅仅因为某些东西在 WebKit 中看起来不错,并不能保证它在 Firefox 中看起来不错。
  • Firefox 3.6.8 我还添加了 CSS

标签: html firefox forms


【解决方案1】:

我用 firefox 3.6.8 尝试了您的代码,但没有遇到您遇到的问题。我也不认为 Firefox 会操纵 DOM(将按钮移动到表单标签中),会发生什么接缝。

所以我猜它是您的 Firefox 扩展之一,这会导致问题。

【讨论】:

  • 我卸载并重新安装 FF 仍然发生同样的事情:(
【解决方案2】:

可能值得尝试卸载并安装 firefox 并重新启动旧式。

【讨论】:

    【解决方案3】:

    大家好,感谢 Kroc Camen,我想通了。在 Firefox 中,我不能将某些东西向右浮动,除非它在包装元素中是第一个按顺序排列的。 (自 90 年代以来的引擎怪癖)哈哈 谢谢您的帮助!

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-04-07
      • 1970-01-01
      • 2019-10-14
      • 2013-02-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-01-07
      相关资源
      最近更新 更多