YouTip LogoYouTip

Att Iframe Srcdoc

## HTML ` ``` ### Attribute Values | Value | Description | | :--- | :--- | | `HTML_code` | The HTML markup to be displayed inside the iframe. The value must be valid HTML syntax. | --- ## Code Examples ### Basic Example In this example, the browser will render the paragraph "Hello world!" defined in the `srcdoc` attribute. If the browser does not support `srcdoc`, it will load `fallback.html` instead. ```html ``` ### Advanced Example with Escaped HTML and Sandboxing When embedding more complex HTML inside `srcdoc`, you must properly escape quotes. It is also highly recommended to use the `sandbox` attribute to secure the inline content. ```html ``` --- ## Browser Support The numbers in the table specify the first browser version that fully supports the `srcdoc` attribute. | Attribute | Chrome | Edge | Firefox | Safari | Opera | | :--- | :--- | :--- | :--- | :--- | :--- | | **srcdoc** | 20.0 | 79.0 | 25.0 | 6.0 | 15.0 | *Note: Legacy versions of Internet Explorer do not support the `srcdoc` attribute.* --- ## HTML 4.01 and HTML5 Differences * The `srcdoc` attribute is a new feature introduced in **HTML5**. It did not exist in HTML 4.01.
← Att Iframe WidthAtt Iframe Sandbox β†’