diff options
author | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:41:15 -0500 |
---|---|---|
committer | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:41:15 -0500 |
commit | 4b1a9203c547c019fc5398082ae19a3f3d4c3efe (patch) | |
tree | d4a40e13ceeb9f85479605110a76e7a4d5f3b56b /files/ca/web/css/_colon_fullscreen | |
parent | 33058f2b292b3a581333bdfb21b8f671898c5060 (diff) | |
download | translated-content-4b1a9203c547c019fc5398082ae19a3f3d4c3efe.tar.gz translated-content-4b1a9203c547c019fc5398082ae19a3f3d4c3efe.tar.bz2 translated-content-4b1a9203c547c019fc5398082ae19a3f3d4c3efe.zip |
initial commit
Diffstat (limited to 'files/ca/web/css/_colon_fullscreen')
-rw-r--r-- | files/ca/web/css/_colon_fullscreen/index.html | 241 |
1 files changed, 241 insertions, 0 deletions
diff --git a/files/ca/web/css/_colon_fullscreen/index.html b/files/ca/web/css/_colon_fullscreen/index.html new file mode 100644 index 0000000000..f1a7bad43f --- /dev/null +++ b/files/ca/web/css/_colon_fullscreen/index.html @@ -0,0 +1,241 @@ +--- +title: ':fullscreen' +slug: 'Web/CSS/:fullscreen' +tags: + - CSS + - Experimental + - Full-screen + - Pseudo-class + - Reference +translation_of: 'Web/CSS/:fullscreen' +--- +<div>{{CSSRef}} {{SeeCompatTable}}</div> + +<p>La <a href="/en-US/docs/Web/CSS/Pseudo-classes">pseudo-class</a> <a href="/en-US/docs/Web/CSS">CSS</a> <strong><code>:fullscreen</code></strong> <span id="result_box" lang="ca"><span>representa un element que es mostra quan el navegador està en <a href="/en-US/docs/Web/API/Fullscreen_API">mode de pantalla completa (</a></span></span><a href="/en-US/docs/Web/API/Fullscreen_API">fullscreen mode)</a>.</p> + +<pre class="brush: css no-line-numbers">/* <span id="result_box" lang="ca"><span>Selecciona qualsevol <div> que es mostri en mode de pantalla completa</span></span> */ +/* <span id="result_box" lang="ca"><span>S'ha implementat a Firefox, WebKit / Chrome i Edge / IE amb prefixos;</span> <span>Edge també és compatible amb la versió no prefixada</span></span> */ +div:-moz-full-screen { + background-color: pink; +} + +div:-webkit-full-screen { + background-color: pink; +} + +div:fullscreen { + background-color: pink; +}</pre> + +<div class="note"> +<p><strong>Note</strong>: L'especificació del W3C utilitza la paraula única <code>:fullscreen</code>, - sense guió -, però ambdues implementacions experimentals de WebKit i Gecko utilitzen una variant prefixada amb dues paraules separades per un guió: <code>:-webkit-full-screen</code> i <code>:-moz-full-screen</code>, respectivament. Microsoft Edge i Internet Explorer utilitzen la convenció estàndard: <code>:fullscreen</code> i <code>:-ms-fullscreen</code>, respectivament.</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"><div id="fullscreen"> + <h1>:fullscreen Demo</h1> + <p>This text will become big and red when the browser is in fullscreen mode.</p> + <button id="fullscreen-button">Enter Fullscreen</button> +</div> +</pre> + +<div class="hidden"> +<h3 id="JavaScript">JavaScript</h3> + +<pre class="brush: js">var fullscreenButton = document.getElementById("fullscreen-button"); +var fullscreenDiv = document.getElementById("fullscreen"); +var fullscreenFunc = fullscreenDiv.requestFullscreen; + +if (!fullscreenFunc) { + ['mozRequestFullScreen', + 'msRequestFullscreen', + 'webkitRequestFullScreen'].forEach(function (req) { + fullscreenFunc = fullscreenFunc || fullscreenDiv[req]; + }); +} + +function enterFullscreen() { + fullscreenFunc.call(fullscreenDiv); +} + +fullscreenButton.addEventListener('click', enterFullscreen); +</pre> + +<h3 id="CSS_específic_del_navegador"><span class="short_text" id="result_box" lang="ca"><span>CSS específic del navegador</span></span></h3> + +<pre class="brush: css">#fullscreen:-moz-full-screen { + padding: 42px; + background-color: pink; + border: 2px solid #f00; + font-size: 200%; +} +#fullscreen:-webkit-full-screen { + padding: 42px; + background-color: pink; + border: 2px solid #f00; + font-size: 200%; +} + +#fullscreen:-moz-full-screen > h1 { + color: red; +} +#fullscreen:-webkit-full-screen > h1 { + color: red; +} + +#fullscreen:-moz-full-screen > p { + color: darkred; +} +#fullscreen:-webkit-full-screen > p { + color: darkred; +} + +#fullscreen:-moz-full-screen > button { + display: none; +} +#fullscreen:-webkit-full-screen > button { + display: none; +} +</pre> +</div> + +<h3 id="CSS">CSS</h3> + +<pre class="brush: css">#fullscreen:fullscreen { + padding: 42px; + background-color: pink; + border:2px solid #f00; + font-size: 200%; +} + +#fullscreen:fullscreen > h1 { + color: red; +} + +#fullscreen:fullscreen > p { + color: darkred; +} + +#fullscreen:fullscreen > button { + display: none; +} +</pre> + +<h3 id="Resultats">Resultats</h3> + +<p>{{ LiveSampleLink('Example', "Feu clic aquí per provar aquest exemple.") }}</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('Fullscreen', '#:fullscreen-pseudo-class', ':fullscreen')}}</td> + <td>{{Spec2('Fullscreen')}}</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>Edge</th> + <th>Firefox (Gecko)</th> + <th>Internet Explorer</th> + <th>Opera</th> + <th>Safari</th> + </tr> + <tr> + <td>Suport bàsic</td> + <td>15.0 {{property_prefix("-webkit")}}<sup>[1]</sup></td> + <td>12</td> + <td>{{CompatGeckoDesktop("9.0")}}{{property_prefix("-moz")}}<sup>[1]</sup><br> + {{CompatGeckoDesktop("47.0")}}<sup>[2]</sup></td> + <td>11 {{property_prefix("-ms")}}<sup>[3]</sup></td> + <td>{{CompatUnknown}}</td> + <td>6.0 {{property_prefix("-webkit")}}<sup>[1]</sup></td> + </tr> + <tr> + <td>Seleccionar tots els elements en la pila de la pantalla completa</td> + <td>{{CompatUnknown}}</td> + <td>12</td> + <td>{{CompatGeckoDesktop(43)}}</td> + <td>11</td> + <td>{{CompatUnknown}}</td> + <td>{{CompatUnknown}}</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>{{CompatUnknown}}</td> + <td>{{CompatVersionUnknown}}</td> + <td>{{CompatGeckoMobile("9.0")}}<br> + {{CompatGeckoDesktop("47.0")}}<sup>[2]</sup></td> + <td>{{CompatNo}}</td> + <td>{{CompatNo}}</td> + <td>{{CompatNo}}</td> + </tr> + <tr> + <td>Seleccionar tots els elements en la pila de la pantalla completa</td> + <td>{{CompatUnknown}}</td> + <td>{{CompatVersionUnknown}}</td> + <td>{{CompatGeckoMobile("43")}}</td> + <td>{{CompatUnknown}}</td> + <td>{{CompatUnknown}}</td> + <td>{{CompatUnknown}}</td> + </tr> + </tbody> +</table> +</div> + +<p>[1] <span id="result_box" lang="ca"><span>Tant les versions prefixades de WebKit com Gecko</span> tenen un guió entre <em>full</em> i <em>screen,</em> però la proposta de W3C utilitza una sola paraula: <code>:fullscreen</code>, <code>:-webkit-full-screen</code>, <code>:-moz-full-screen</code>.</span></p> + +<p>[2]<em> </em>Gecko 47.0 {{geckoRelease("47.0")}} implementa la pseudo-classe sense prefix darrere de la preferència <code>full-screen-api.unprefix.enabled</code>, per defecte a <code>false</code>.</p> + +<p>[3] Internet Explorer utilitza el prefix <code>-ms</code> però no té un guió entre full i screen: <code>:-ms-fullscreen</code>.</p> + +<h2 id="Vegeu_també">Vegeu també</h2> + +<ul> + <li><a href="/en-US/docs/Web/API/Fullscreen_API">Ùs del mode de pantalla completa</a></li> + <li>{{cssxref("::backdrop")}}</li> + <li>DOM API: {{ domxref("Element.requestFullscreen()") }}, {{ domxref("Document.exitFullscreen()") }}, {{ domxref("Document.fullscreen") }}, {{ domxref("Document.fullscreenElement") }}</li> + <li>Atribut {{HTMLAttrXRef("allowfullscreen", "iframe")}}</li> +</ul> |