diff options
Diffstat (limited to 'files/pt-br/web/css/_colon_fullscreen/index.html')
-rw-r--r-- | files/pt-br/web/css/_colon_fullscreen/index.html | 87 |
1 files changed, 87 insertions, 0 deletions
diff --git a/files/pt-br/web/css/_colon_fullscreen/index.html b/files/pt-br/web/css/_colon_fullscreen/index.html new file mode 100644 index 0000000000..7d721684ab --- /dev/null +++ b/files/pt-br/web/css/_colon_fullscreen/index.html @@ -0,0 +1,87 @@ +--- +title: ':fullscreen' +slug: 'Web/CSS/:fullscreen' +translation_of: 'Web/CSS/:fullscreen' +--- +<div>{{CSSRef}}</div> + +<p><span class="seoSummary">A pseudo-classe <strong><code>:fullscreen</code></strong> do CSS representa os elementos que estão atualmente no modo tela-cheia. Se vários elementos estiverem em tela-cheia, isto seleciona todos.</span></p> + +<h2 id="Sintaxe">Sintaxe</h2> + +<pre class="syntaxbox notranslate">{{csssyntax}}</pre> + +<h2 id="Usage_notes">Usage notes</h2> + +<p>The <code>:fullscreen</code> pseudo-class lets you configure your stylesheets to automatically adjust the size, style, or layout of content when elements switch back and forth between full-screen and traditional presentations.</p> + +<h2 id="Examples">Examples</h2> + +<p>In this example, the color of a button is changed depending on whether or not the document is in full-screen mode. This is done without needing to specifically apply style changes using JavaScript.</p> + +<h3 id="HTML">HTML</h3> + +<p>The page's HTML looks like this:</p> + +<pre class="brush: html notranslate"><h1>MDN Web Docs Demo: :fullscreen pseudo-class</h1> + +<p>This demo uses the <code>:fullscreen</code> pseudo-class to automatically + change the style of a button used to toggle full-screen mode on and off, + entirely using CSS.</p> + +<button id="fs-toggle">Toggle Fullscreen</button></pre> + +<p>The {{HTMLElement("button")}} with the ID <code>"fs-toggle"</code> will change between pale red and pale green depending on whether or not the document is in full-screen mode.</p> + +<h3 id="CSS">CSS</h3> + +<p>The magic happens in the CSS. There are two rules here. The first establishes the background color of the "Toggle Full-screen Mode" button when the element is not in a full-screen state. The key is the use of the <code>:not(:fullscreen)</code>, which looks for the element to not have the <code>:fullscreen</code> pseudo-class applied to it.</p> + +<pre class="brush: css notranslate">#fs-toggle:not(:fullscreen) { + background-color: #afa; +} +</pre> + +<p>When the document <em>is</em> in full-screen mode, the following CSS applies instead, setting the background color to a pale shade of red.</p> + +<pre class="brush: css notranslate">#fs-toggle:fullscreen { + background-color: #faa; +}</pre> + +<h2 id="Specifications">Specifications</h2> + +<table class="standard-table"> + <thead> + <tr> + <th scope="col">Specification</th> + <th scope="col">Status</th> + <th scope="col">Comment</th> + </tr> + </thead> + <tbody> + <tr> + <td>{{SpecName('Fullscreen', '#:fullscreen-pseudo-class', ':fullscreen')}}</td> + <td>{{Spec2('Fullscreen')}}</td> + <td>Initial definition.</td> + </tr> + </tbody> +</table> + +<h2 id="Browser_compatibility">Browser compatibility</h2> + +<div> + + +<p>{{Compat("css.selectors.fullscreen")}}</p> +</div> + +<h2 id="See_also">See also</h2> + +<ul> + <li><a href="/en-US/docs/Web/API/Fullscreen_API">Fullscreen API </a></li> + <li><a href="/en-US/docs/Web/API/Fullscreen_API/Guide">Guide to the Fullscreen API</a></li> + <li>{{cssxref(":not")}}</li> + <li>{{cssxref("::backdrop")}}</li> + <li>DOM API: {{ domxref("Element.requestFullscreen()") }}, {{ domxref("Document.exitFullscreen()") }}, {{ domxref("Document.fullscreenElement") }}</li> + <li>{{HTMLAttrXRef("allowfullscreen", "iframe")}} attribute</li> +</ul> |