iframe

The iframe HTML element introduces a new nested browsing context.

Syntax

HTML

<iframe attribute-name="attribute-value"></iframe>

Attributes

Global

Name Value Description
height non-negative integer Vertical dimension
name browsing-context name Valid browsing context name
sandbox sandbox allow list Instructs the UA to enable a set of extra restrictions on any content hosted by the iframe
seamless seamless | empty Instructs the UA that the iframe element's browsing context is to be rendered in a manner that makes it appear to be part of the containing document (seamlessly included in the parent document)
src URI URL for the audio stream
srcdoc iframe srcdoc Content of the page that the nested browsing context is to contain
width non-negative integer Horizontal dimension

CSS

iframe
{
    border: 2px inset;
}

Examples

1 · height

2 · name

3 · sandbox

4 · seamless

5 · src

6 · srcdoc

7 · width

8 · Content

9 · CSS | border

10 · CSS | no border

!doctype

a

abbr

address

area

article

aside

audio

b

base

bdi

bdo

blockquote

body

br

button

canvas

caption

cite

code

col

colgroup

data

datalist

dd

del

details

dfn

dialog

div

dl

dt

em

embed

fieldset

figcaption

figure

footer

form

h1

h2

h3

h4

h5

h6

head

header

hgroup

hr

html

i

img

input

ins

kbd

label

legend

li

link

main

map

mark

menu

meta

meter

nav

noscript

object

ol

optgroup

option

output

p

param

picture

pre

progress

q

rb

rp

rt

rtc

ruby

s

samp

script

section

select

slot

small

source

span

strong

style

sub

summary

sup

table

tbody

td

template

textarea

tfoot

th

thead

time

title

tr

track

u

ul

var

video

wbr

Web Hypertext Application Technology Working Group (WHATWG)

Home Menu