Class Iframe


@Bean(typeName="iframe") public class Iframe extends HtmlElementMixed
DTO for an HTML <iframe> element.

The iframe element represents a nested browsing context, embedding another HTML page into the current page. It is commonly used to embed external content such as videos, maps, or other web applications. The sandbox attribute can be used to restrict the capabilities of the embedded content for security purposes.

Examples:

import static org.apache.juneau.bean.html5.HtmlBuilder.*; // Simple iframe embedding external content Iframe iframe1 = iframe() .src("https://example.com/embed") .width("800") .height("600"); // Iframe with sandbox restrictions Iframe iframe2 = iframe() .src("https://example.com/untrusted") .sandbox("allow-scripts allow-same-origin") .width("400") .height("300"); // Iframe with inline content Iframe iframe3 = iframe() .srcdoc("<h1>Inline Content</h1><p>This content is embedded directly.</p>") .width("500") .height("200"); // Iframe with name for targeting Iframe iframe4 = iframe() .name("contentFrame") .src("https://example.com/content") .width("100%") .height("400");

The following convenience methods are provided for constructing instances of this bean:

See Also: