HTML Iframes Tutorial
An iframe
is an HTML element that allows you to embed another HTML document within the current document. This is often used to display content from a different website or to display multimedia content such as videos.
Syntax
<iframe src="url_to_content"></iframe>
The src
attribute specifies the URL of the content you want to display in the iframe
. You can also set other attributes such as width, height, border, and scrolling.
Example
Let's say we want to embed a Google Maps location in our website:
<iframe src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d3305.135725582625!2d-118.32285998478373!3d34.06135522049895!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x80c2c610f682a005%3A0x6f3a1562ee177179!2sSanta%20Monica%20Pier!5e0!3m2!1sen!2sus!4v1635898936006!5m2!1sen!2sus"
width="600" height="450"></iframe>