iFrame

15 Aug 2022

How to embed a website with an iFrame ("inline frame"):

Example

<iframe loading="lazy" src="https://indexall.io/airgun/brands" style="border:1px #000;" scrolling="yes" frameborder="1" marginheight="0px" marginwidth="0px" height="600px" width="800px" allowfullscreen></iframe>

Attributes

Attribute Value Description
src URL Specifies the URL of the webpage/document/map/video to embed
name text Specifies the name of an iframe
scrolling auto, yes, no Indicates when the browser should provide a scrollbar for the frame: ‘auto’ – only when the frame’s content is larger than its dimensions, ‘yes’ – always show a scrollbar, ‘no’ – never show a scrollbar
frameborder integer Draws a border around this frame. Default frameborder is 1. The value 0 removes the border around this frame
marginheight integer The amount of space in pixels between the frame’s content and its top and bottom borders
marginwidth integer The amount of space in pixels between the frame’s content and its left and right borders
height pixels Specifies the height of an iframe. Default height is 150 pixels
width pixels Specifies the width of an iframe. Default width is 300 pixels
allowfullscreen TRUE,FALSE Set to true if the can activate fullscreen mode by calling the requestFullscreen() method
allow Specifies a feature policy for the iframe
srcdoc HTML_code Specifies the HTML content of the page to show in the iframe
align left,center,right The alignment of the iframe with respect to the surrounding context
referrerpolicy no-referrer,no-referrer-when-downgrade,origin,origin-when-cross-origin,same-origin,strict-origin,strict-origin-when-cross-origin,unsafe-url Specifies how much/which referrer information that will be sent when processing the iframe attributes
sandbox allow-forms,allow-pointer-lock,allow-popups,allow-same-origin,allow-scripts,allow-top-navigation Enables an extra set of restrictions for the content in an iframe

links

social