<iframe attribute-name="attribute-value"></iframe>
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
iframe
{
border: 2px inset;
}
<!doctype html>
<html>
<body>
<iframe name="myname" src="/"></iframe>
</body>
</html>
<!doctype html>
<html>
<body>
<iframe sandbox="allow-same-origin" src="/"></iframe>
</body>
</html>
<!doctype html>
<html>
<body>
<iframe seamless src="/"></iframe>
</body>
</html>
<!doctype html>
<html>
<body>
<iframe src="/"></iframe>
</body>
</html>
<!doctype html>
<html>
<body>
<iframe src="/" srcdoc="<a href='/'>srcdoc overrides src</a>"></iframe>
</body>
</html>
<!doctype html>
<html>
<body>
<iframe src="/" width="100%"></iframe>
</body>
</html>
<!doctype html>
<html>
<body>
<iframe src="/">your browser does not support iframe</iframe>
</body>
</html>
<!doctype html>
<html>
<head>
<style>
iframe
{
border: 2px inset;
}
</style>
</head>
<body>
<iframe srcdoc="<a href='/'>border</a>"></iframe>
</body>
</html>
<!doctype html>
<html>
<head>
<style>
html
{
height: 100%;
}
body
{
height: 100%;
margin: 0;
}
iframe
{
border: none;
display: block;
height: 100%;
width: 100%;
}
</style>
</head>
<body>
<iframe srcdoc="<a href='/'>no border</a>"></iframe>
</body>
</html>