aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/conflicting/web/css/_doublecolon_placeholder/index.html
diff options
context:
space:
mode:
Diffstat (limited to 'files/zh-cn/conflicting/web/css/_doublecolon_placeholder/index.html')
-rw-r--r--files/zh-cn/conflicting/web/css/_doublecolon_placeholder/index.html100
1 files changed, 100 insertions, 0 deletions
diff --git a/files/zh-cn/conflicting/web/css/_doublecolon_placeholder/index.html b/files/zh-cn/conflicting/web/css/_doublecolon_placeholder/index.html
new file mode 100644
index 0000000000..b66dc3a6ef
--- /dev/null
+++ b/files/zh-cn/conflicting/web/css/_doublecolon_placeholder/index.html
@@ -0,0 +1,100 @@
+---
+title: '::-moz-placeholder'
+slug: conflicting/Web/CSS/::placeholder
+tags:
+ - CSS
+ - CSS Pseudo-class
+ - CSS Reference
+ - Non-standard
+translation_of: Web/CSS/::placeholder
+translation_of_original: Web/CSS/::-moz-placeholder
+original_slug: Web/CSS/::-moz-placeholder
+---
+<div>{{Non-standard_header}}{{CSSRef}}</div>
+
+<div class="note"><strong>提示:</strong> {{cssxref('::-moz-placeholder')}} 伪元素在Firefox 19+替代了之前的 <code>:-moz-placeholder </code>伪类.</div>
+
+<div>{{gecko_minversion_header("19.0")}}</div>
+
+<h2 id="摘要">摘要</h2>
+
+<p> <code>::-moz-placeholder</code> 伪元素控制元素所显示的文字占位符.它允许开发者/设计师改变文字占位符的样式.默认的文字占位符为浅灰色,当你的表单背景色为类似的颜色时它可能效果并不是很明显,那么你就可以使用这个伪类来改变文字占位符的颜色.</p>
+
+<h2 id="示例">示例</h2>
+
+<h3 id="HTML_内容">HTML 内容</h3>
+
+<pre class="brush: html">&lt;input id="test" placeholder="Placeholder text!"&gt;</pre>
+
+<h3 id="CSS_内容">CSS 内容</h3>
+
+<pre class="brush: css">input::-moz-placeholder {
+ color: green;
+}</pre>
+
+<p>{{EmbedLiveSample('%E7%A4%BA%E4%BE%8B', '100%', 100)}}</p>
+
+<p> </p>
+
+<h2 id="浏览器兼容性">浏览器兼容性</h2>
+
+<p>{{CompatibilityTable}}</p>
+
+<table>
+ <tbody>
+ <tr>
+ <th>Feature</th>
+ <th>Chrome</th>
+ <th>Firefox (Gecko)</th>
+ <th>Internet Explorer</th>
+ <th>Opera</th>
+ <th>Safari (WebKit)</th>
+ </tr>
+ <tr>
+ <td>Basic support</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatGeckoDesktop("19.0")}}<sup>[1]</sup></td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatUnknown}}</td>
+ </tr>
+ </tbody>
+</table>
+
+<table>
+ <tbody>
+ <tr>
+ <th>Feature</th>
+ <th>Android</th>
+ <th>Firefox Mobile (Gecko)</th>
+ <th>Firefox OS</th>
+ <th>IE Phone</th>
+ <th>Opera Mobile</th>
+ <th>Safari Mobile</th>
+ </tr>
+ <tr>
+ <td>Basic support</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatGeckoMobile("19.0")}}<sup>[1]</sup></td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatUnknown}}</td>
+ </tr>
+ </tbody>
+</table>
+
+<p>[1] Firefox 对placeholder文本默认应用<code>{{cssxref("opacity")}}:0.54。详见</code>{{Bug("556145")}}。大多数主流浏览器目前不会对placeholder文本伪元素或者伪类应用默认样式。</p>
+
+<p>Gecko 此前将本属性视为 {{cssxref(":-moz-placeholder")}}。详见 {{Bug("737786")}}.</p>
+
+<h2 id="See_also" name="See_also">See also</h2>
+
+<ul>
+ <li>{{cssxref("::placeholder")}}</li>
+ <li>{{cssxref("::-webkit-input-placeholder")}}</li>
+ <li>{{cssxref(":-ms-input-placeholder")}}</li>
+ <li><a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Forms_in_HTML">Forms in HTML</a></li>
+ <li>{{HTMLElement("input")}}</li>
+ <li>{{HTMLElement("textarea")}}</li>
+</ul>