我正在使用 Twitter 引导 CSS。您可以在下面看到相同的代码在 FireFox 和 Chrome 中的显示方式不同。
这很奇怪。Firebug 告诉我占位符的 css 设置为浅灰色:
:-moz-placeholder {
color: #999999;
}
这应该会影响所有元素中的所有占位符,因为它在 Chrome 中正确完成。但是在 Firefox 中为什么可以textareas
正确应用,但input
不是呢?我怎样才能解决这个问题?
<input id="id_referred_by" type="text" maxlength="50" name="referred_by" placeholder="...was referred by?">
<textarea id="id_contacts_interests" name="contacts_interests" cols="40" placeholder="Any particular interests?" rows="4"></textarea>
铬合金:
火狐:
更新:
下面的评论给了我一个想法:
Input
has 不像条目textarea
被color: #9999
划掉,这意味着某些东西正在覆盖它。
select, textarea, input[type="text"], input[type="password"], input[type="datetime"], input[type="datetime-local"], input[type="date"], input[type="month"], input[type="time"], input[type="week"], input[type="number"], input[type="email"], input[type="url"], input[type="search"], input[type="tel"], input[type="color"], .uneditable-input {
color: #555555;
display: inline-block;
font-size: 13px;
height: 18px;
line-height: 18px;
margin-bottom: 9px;
padding: 4px;
}
事实上就是这样color: #555555;
。当我在萤火虫中禁用它时,一切正常。为什么 Chrome 不关心这个而 Firefox 关心?任何提示如何在两个浏览器中解决此问题?我对 CSS 还是很陌生。