aboutsummaryrefslogtreecommitdiff
path: root/files/ca/web/css/_doublecolon_placeholder/index.html
blob: 3c985e791247c0e6f8f1cb7ec78a400d75363249 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
---
title: '::placeholder'
slug: 'Web/CSS/::placeholder'
tags:
  - CSS
  - Experimental
  - NeedsBrowserCompatibility
  - NeedsMobileBrowserCompatibility
  - Pseudo-element
  - Reference
translation_of: 'Web/CSS/::placeholder'
---
<div>{{CSSRef}}{{SeeCompatTable}}</div>

<p>El <a href="/en-US/docs/Web/CSS/Pseudo-elements">pseudo-element</a> <a href="/en-US/docs/Web/CSS">CSS</a> <strong><code>::placeholder</code></strong> representa el <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Forms_in_HTML#The_placeholder_attribute">text de marcador de posició</a> d'un element de <a href="https://developer.mozilla.org/en-US/docs/Learn/HTML/Forms">formulari</a>.</p>

<pre class="brush: css no-line-numbers">::placeholder {
  color: blue;
  font-size: 1.5em;
}</pre>

<p>Només un subconjunt de propietats CSS que s'aplica al pseudo-element {{cssxref("::first-line")}} es pot utilitzar en una regla, utilitzant <code>::placeholder</code> en el seu selector.</p>

<div class="note">
<p><strong>Nota:</strong> A Firefox, l'aparença del text del marcador de posició és de color gris translúcid per defecte.</p>
</div>

<h2 id="Sintaxi">Sintaxi</h2>

<pre class="syntaxbox">{{csssyntax}}</pre>

<h2 id="Exemple">Exemple</h2>

<h3 id="HTML">HTML</h3>

<pre class="brush:html line-numbers language-html">&lt;input placeholder="Type something here!"&gt;</pre>

<h3 id="CSS">CSS</h3>

<pre class="brush: css">input::placeholder {
  color: red;
  font-size: 1.2em;
  font-style: italic;
}</pre>

<h3 id="Resultat">Resultat</h3>

<p>{{EmbedLiveSample("Example")}}</p>

<h2 id="Especificacions">Especificacions</h2>

<table class="standard-table">
 <thead>
  <tr>
   <th scope="col">Especificació</th>
   <th scope="col">Estat</th>
   <th scope="col">Comentari</th>
  </tr>
 </thead>
 <tbody>
  <tr>
   <td>{{SpecName('CSS4 Pseudo-Elements', '#placeholder-pseudo', '::placeholder')}}</td>
   <td>{{Spec2('CSS4 Pseudo-Elements')}}</td>
   <td>Definició inicial.</td>
  </tr>
 </tbody>
</table>

<h2 id="Navegadors_compatibles">Navegadors compatibles</h2>

<p>{{CompatibilityTable}}</p>

<div id="compat-desktop">
<table class="compat-table">
 <tbody>
  <tr>
   <th>Descripció</th>
   <th>Chrome</th>
   <th>Firefox (Gecko)</th>
   <th>Edge</th>
   <th>Internet Explorer</th>
   <th>Opera</th>
   <th>Safari</th>
  </tr>
  <tr>
   <td>Suport bàsic</td>
   <td>{{CompatChrome(57)}}</td>
   <td>{{CompatGeckoDesktop("51.0")}}<sup>[1]</sup></td>
   <td>{{CompatNo}}</td>
   <td>{{CompatNo}}</td>
   <td>44</td>
   <td>10.1</td>
  </tr>
  <tr>
   <td><span class="short_text" id="result_box" lang="ca"><span>Suport parcial amb prefix</span></span></td>
   <td>Supported</td>
   <td>Supported</td>
   <td>Supported</td>
   <td>10 -ms-</td>
   <td>Supported</td>
   <td>5 -webkit-</td>
  </tr>
 </tbody>
</table>
</div>

<div id="compat-mobile">
<table class="compat-table">
 <tbody>
  <tr>
   <th>Descripció</th>
   <th>Android</th>
   <th>Chrome for Android</th>
   <th>Firefox Mobile (Gecko)</th>
   <th>IE Mobile</th>
   <th>Opera Mobile</th>
   <th>Safari Mobile</th>
  </tr>
  <tr>
   <td>Suport bàsic</td>
   <td>{{CompatChrome(57)}}</td>
   <td>{{CompatChrome(57)}}</td>
   <td>{{CompatGeckoMobile("52.0")}}</td>
   <td>{{CompatNo}}</td>
   <td> </td>
   <td>10.3</td>
  </tr>
  <tr>
   <td><span class="short_text" id="result_box" lang="ca"><span>Suport parcial amb prefix</span></span></td>
   <td>2.1 -webkit-</td>
   <td>Supported</td>
   <td>Supported</td>
   <td>10 -ms-</td>
   <td>37 -webkit-</td>
   <td>4.3 -webkit-</td>
  </tr>
 </tbody>
</table>
</div>

<p>[1] Abans de Gecko 51.0 {{geckoRelease("51.0")}} Gecko va implementar aquest com a pseudo-element prefixat {{cssxref("::-moz-placeholder")}}.</p>

<h2 id="Vegeu_també">Vegeu també</h2>

<ul>
 <li>La pseudo-class {{cssxref(":placeholder-shown")}} dona estil a un element que <em></em> un marcador de posició actiu.</li>
 <li>Elements HTML relacionats: {{HTMLElement("input")}}, {{HTMLElement("textarea")}}</li>
 <li>Els equivalents no estàndard d'aquest pseudo-element: {{cssxref("::-webkit-input-placeholder")}}, {{cssxref("::-moz-placeholder")}}, {{cssxref(":-ms-input-placeholder")}}</li>
 <li><a href="/en-US/docs/Learn/HTML/Forms">Formularis HTML</a></li>
</ul>