【问题标题】:Placeholder not showing占位符不显示
【发布时间】:2015-04-22 00:22:33
【问题描述】:

我有这个 HTML 代码:

<form method="post">
    <input class="field_a" name="name" type="text" placeholder="Enter your name here"><br />
    <input class="field_a" name="email" type="email" placeholder="And your email is?"><br />
    <input class="field_a" name="subject" type="text" placeholder="We need to know what your message is about"><br />
    <textarea class="field_b" name="message" rows="10" cols="25" placeholder="Finally, the message.."></textarea><br />
    <input class="field_c" name="send_mail" type="submit" value="Ready to send your message?">
</form>

但由于某种原因,我的占位符没有显示。这方面的帮助会很棒。

【问题讨论】:

  • 看起来可以正常工作
  • 您使用的是什么版本的浏览器?
  • 嗯.. 不适合我prntscr.com/6whx6z
  • 我使用的是 Chrome,但我也检查了 IE,但它没有显示。
  • @JugglingBob 什么版本的 chrome...?

标签: html placeholder


【解决方案1】:

我找到了为什么它不起作用的原因。

我有这个 CSS:

*::-webkit-input-placeholder {
    color: #fff;
}
*:-moz-placeholder {
    /* FF 4-18 */
    color: #fff;
}
*::-moz-placeholder {
    /* FF 19+ */
    color: #fff;
}
*:-ms-input-placeholder {
    /* IE 10+ */
    color: #fff;
}

【讨论】:

  • 这说明了为什么在提问时提供所有相关代码很重要 ;)
猜你喜欢
  • 2016-10-04
  • 1970-01-01
  • 2014-12-07
  • 1970-01-01
  • 2013-06-27
  • 1970-01-01
  • 2012-10-27
  • 1970-01-01
相关资源
最近更新 更多