From 68fc8e96a9629e73469ed457abd955e548ec670c Mon Sep 17 00:00:00 2001 From: Florian Merz Date: Thu, 11 Feb 2021 14:49:58 +0100 Subject: unslug pt-br: move --- files/pt-br/web/html/element/content/index.html | 101 ++++++++++++++++++++++++ 1 file changed, 101 insertions(+) create mode 100644 files/pt-br/web/html/element/content/index.html (limited to 'files/pt-br/web/html/element/content/index.html') diff --git a/files/pt-br/web/html/element/content/index.html b/files/pt-br/web/html/element/content/index.html new file mode 100644 index 0000000000..1a1832de04 --- /dev/null +++ b/files/pt-br/web/html/element/content/index.html @@ -0,0 +1,101 @@ +--- +title: ': The Shadow DOM Content Placeholder element (obsolete)' +slug: Web/HTML/Element/conteúdo +translation_of: Web/HTML/Element/content +--- +
{{Deprecated_header}}
+ +

The HTML <content> element—an obsolete part of the Web Components suite of technologies—was used inside of Shadow DOM as an {{glossary("insertion point")}}, and wasn't meant to be used in ordinary HTML. It has now been replaced by the {{HTMLElement("slot")}} element, which creates a point in the DOM at which a shadow DOM can be inserted.

+ +
+

Note: Though present in early draft of the specifications and implemented in several browsers, this element has been removed in later versions of the spec, and should not be used. It is documented here to assist in adapting code written during the time it was included in the spec to work with newer versions of the specification.

+
+ + + + + + + + + + + + + + + + + + + + + + + + +
Content categoriesTransparent content.
Permitted contentFlow content.
Tag omission{{no_tag_omission}}
Permitted parent elementsAny element that accepts flow content.
DOM interface{{domxref("HTMLContentElement")}}
+ +

Attributes

+ +

This element includes the global attributes.

+ +
+
select
+
A comma-separated list of selectors. These have the same syntax as CSS selectors. They select the content to insert in place of the <content> element.
+
+ +

Example

+ +

Here is a simple example of using the <content> element. It is an HTML file with everything needed in it.

+ +
+

Note: For this code to work, the browser you display it in must support Web Components. See Enabling Web Components in Firefox.

+
+ +
<html>
+  <head></head>
+  <body>
+  <!-- The original content accessed by <content> -->
+  <div>
+    <h4>My Content Heading</h4>
+    <p>My content text</p>
+  </div>
+
+  <script>
+  // Get the <div> above.
+  var myContent = document.querySelector('div');
+  // Create a shadow DOM on the <div>
+  var shadowroot = myContent.createShadowRoot();
+  // Insert into the shadow DOM a new heading and
+  // part of the original content: the <p> tag.
+  shadowroot.innerHTML =
+   '<h2>Inserted Heading</h2> <content select="p"></content>';
+  </script>
+
+  </body>
+</html>
+
+ +

If you display this in a web browser it should look like the following.

+ +

content example

+ +

Specifications

+ +

This element is no longer defined by any specifications.

+ +

Browser compatibility

+ + + +

{{Compat("html.elements.content")}}

+ +

See also

+ + + +
{{HTMLRef}}
-- cgit v1.2.3-54-g00ecf