aboutsummaryrefslogtreecommitdiff
path: root/files/ca/web/css/_colon_active/index.html
diff options
context:
space:
mode:
Diffstat (limited to 'files/ca/web/css/_colon_active/index.html')
-rw-r--r--files/ca/web/css/_colon_active/index.html166
1 files changed, 166 insertions, 0 deletions
diff --git a/files/ca/web/css/_colon_active/index.html b/files/ca/web/css/_colon_active/index.html
new file mode 100644
index 0000000000..ee066e1a03
--- /dev/null
+++ b/files/ca/web/css/_colon_active/index.html
@@ -0,0 +1,166 @@
+---
+title: ':active'
+slug: 'Web/CSS/:active'
+tags:
+ - CSS
+ - CSS Pseudo-class
+ - Layout
+ - Reference
+ - Web
+translation_of: 'Web/CSS/:active'
+---
+<div>{{CSSRef}}</div>
+
+<p>La <a href="/en-US/docs/CSS/Pseudo-classes" title="Pseudo-classes">pseudo-class</a> CSS <code>:active</code> representa un element (com un botó) que està sent activat per l'usuari. Quan s'usa un ratolí, l'"activació" normalment comença quan l'usuari pressiona el botó primari del ratolí i acaba quan es deixa anar. La pseudo-classe <code>:active</code> s'usa comunament en elements {{HTMLElement("a")}} i {{HTMLElement("button")}}, però també pot usar-se en altres elements.</p>
+
+<pre class="brush: css no-line-numbers">/* Selects any &lt;a&gt; that is being activated */
+a:active {
+ color: red;
+}</pre>
+
+<p>Els estils definits per la pseudo-class <code>:active</code> seran anul·lats per qualsevol pseudo-class subsegüent relacionada amb l'enllaç ({{cssxref(":link")}}, {{cssxref(":hover")}} o {{cssxref(":visited")}}) que tingui almenys la mateixa especificitat. Per donar un estil apropiat als enllaços, poseu la regla <code>:active</code> després de totes les altres regles relacionades amb els enllaços, tal com ho defineix l'ordre <em>LVHA-order</em>: <code>:link</code> — <code>:visited</code> — <code>:hover</code> — <code>:active</code>.</p>
+
+<div class="note"><strong>Nota:</strong> En sistemes amb ratolins de múltiples botons, CSS 3 especifica que la pseudo-class <code>:active</code> només s'ha d'aplicar al botó primari; en ratolins destres, normalment és el botó més a l'esquerra.</div>
+
+<h2 id="Sintaxi">Sintaxi</h2>
+
+<pre class="syntaxbox">{{csssyntax}}</pre>
+
+<h2 id="Example" name="Example">Exemple</h2>
+
+<div id="example">
+<h3 id="HTML">HTML</h3>
+
+<pre class="brush: html;">&lt;a href="#"&gt;This link will turn lime while you click on it.&lt;/a&gt;
+</pre>
+
+<h3 id="CSS">CSS</h3>
+
+<pre class="brush: css;">a:link { color: blue; } /* Unvisited links */
+a:visited { color: purple; } /* Visited links */
+a:hover { <span class="st">background: yellow</span>; } /* User hovers */
+a:active { color: lime; } /* Active links */</pre>
+</div>
+
+<h3 id="Resultat">Resultat</h3>
+
+<div>{{EmbedLiveSample('Example')}}</div>
+
+<h2 id="Especificacions"><span>Especificacions</span></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('HTML WHATWG', 'scripting.html#selector-active', ':active')}}</td>
+ <td>{{Spec2('HTML WHATWG')}}</td>
+ <td> </td>
+ </tr>
+ <tr>
+ <td>{{SpecName('CSS4 Selectors', '#active-pseudo', ':active')}}</td>
+ <td>{{Spec2('CSS4 Selectors')}}</td>
+ <td>Sense canvis.</td>
+ </tr>
+ <tr>
+ <td>{{SpecName('CSS3 Selectors', '#useraction-pseudos', ':active')}}</td>
+ <td>{{Spec2('CSS3 Selectors')}}</td>
+ <td>Sense canvis.</td>
+ </tr>
+ <tr>
+ <td>{{SpecName('CSS2.1', 'selector.html#dynamic-pseudo-classes', ':active')}}</td>
+ <td>{{Spec2('CSS2.1')}}</td>
+ <td>Sense canvis.</td>
+ </tr>
+ <tr>
+ <td>{{SpecName('CSS1', '#anchor-pseudo-classes', ':active')}}</td>
+ <td>{{Spec2('CSS1')}}</td>
+ <td>Definició inicial.</td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="Navegadors_compatibles">Navegadors compatibles</h2>
+
+<div>{{CompatibilityTable}}</div>
+
+<div id="compat-desktop">
+<table class="compat-table">
+ <tbody>
+ <tr>
+ <th>Descripció</th>
+ <th>Chrome</th>
+ <th>Edge</th>
+ <th>Firefox (Gecko)</th>
+ <th>Internet Explorer</th>
+ <th>Opera</th>
+ <th>Safari</th>
+ </tr>
+ <tr>
+ <td>Suport bàsic</td>
+ <td>1.0</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatGeckoDesktop("1.0")}}</td>
+ <td>4.0</td>
+ <td>5.0</td>
+ <td>1.0</td>
+ </tr>
+ <tr>
+ <td><span class="short_text" id="result_box" lang="ca"><span>Suport en elements no</span></span> <code>&lt;a&gt;</code></td>
+ <td>1.0</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatGeckoDesktop("1.0")}}</td>
+ <td>8.0</td>
+ <td>7.0</td>
+ <td>1.0</td>
+ </tr>
+ </tbody>
+</table>
+</div>
+
+<div id="compat-mobile">
+<table class="compat-table">
+ <tbody>
+ <tr>
+ <th>Descripció</th>
+ <th>Android</th>
+ <th>Edge</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>1.0</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatGeckoMobile("1.0")}}</td>
+ <td>6.0</td>
+ <td>6.0</td>
+ <td>1.0</td>
+ </tr>
+ <tr>
+ <td><span class="short_text" id="result_box" lang="ca"><span>Suport en elements no</span></span> <code>&lt;a&gt;</code></td>
+ <td>1.0</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatGeckoMobile("1.0")}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatVersionUnknown}} [1]</td>
+ </tr>
+ </tbody>
+</table>
+</div>
+
+<p>[1] Per defecte, Safari Mobile no utilitza l'estat {{cssxref(":active")}} a menys que hi hagi un controlador d'esdeveniments <a href="/en-US/docs/Web/Reference/Events/touchstart"><code>touchstart</code></a> en l'element rellevant o en el {{HTMLElement("body")}}.</p>
+
+<h2 id="Vegeu_també">Vegeu també</h2>
+
+<ul>
+ <li>Enllaços relacionats amb pseudo-classes: {{cssxref(":link")}}, {{cssxref(":visited")}} i {{cssxref(":hover")}}.</li>
+</ul>