From 074785cea106179cb3305637055ab0a009ca74f2 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:42:52 -0500 Subject: initial commit --- files/pt-br/web/css/_colon_fullscreen/index.html | 87 ++++++++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 files/pt-br/web/css/_colon_fullscreen/index.html (limited to 'files/pt-br/web/css/_colon_fullscreen') 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' +--- +
{{CSSRef}}
+ +

A pseudo-classe :fullscreen do CSS representa os elementos que estão atualmente no modo tela-cheia. Se vários elementos estiverem em tela-cheia, isto seleciona todos.

+ +

Sintaxe

+ +
{{csssyntax}}
+ +

Usage notes

+ +

The :fullscreen 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.

+ +

Examples

+ +

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.

+ +

HTML

+ +

The page's HTML looks like this:

+ +
<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>
+ +

The {{HTMLElement("button")}} with the ID "fs-toggle" will change between pale red and pale green depending on whether or not the document is in full-screen mode.

+ +

CSS

+ +

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 :not(:fullscreen), which looks for the element to not have the :fullscreen pseudo-class applied to it.

+ +
#fs-toggle:not(:fullscreen) {
+  background-color: #afa;
+}
+
+ +

When the document is in full-screen mode, the following CSS applies instead, setting the background color to a pale shade of red.

+ +
#fs-toggle:fullscreen {
+  background-color: #faa;
+}
+ +

Specifications

+ + + + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('Fullscreen', '#:fullscreen-pseudo-class', ':fullscreen')}}{{Spec2('Fullscreen')}}Initial definition.
+ +

Browser compatibility

+ +
+ + +

{{Compat("css.selectors.fullscreen")}}

+
+ +

See also

+ + -- cgit v1.2.3-54-g00ecf