Attributo HTML <iframe> srcdoc
Esempio
Un <iframe> con un attributo srcdoc:
<iframe srcdoc="<p>Hello world!</p>" src="demo_iframe_srcdoc.htm"></iframe>
Definizione e utilizzo
L' srcdoc
attributo specifica il contenuto HTML della pagina da mostrare nel frame inline.
Suggerimento: si prevede che questo attributo venga utilizzato insieme agli attributi
sandbox
e .seamless
Se un browser supporta l' srcdoc
attributo, sovrascriverà il contenuto specificato
src
nell'attributo (se presente).
Se un browser NON supporta l' srcdoc
attributo, mostrerà invece il file specificato
src
nell'attributo (se presente).
Supporto browser
I numeri nella tabella specificano la prima versione del browser che supporta completamente l'attributo.
Attribute | |||||
---|---|---|---|---|---|
srcdoc | 20.0 | 79.0 | 25.0 | 6.0 | 15.0 |
Sintassi
<iframe srcdoc="HTML_code">
Valori di attributo
Value | Description |
---|---|
HTML_code | The HTML content to show in the iframe. Must be valid HTML syntax |
❮ Tag HTML <iframe>