02Geek HTML5 and JavaScript, TypeScript, React, Flash, ActionScript online School
Previous VideoNext Video

Creating an iframe

By the end of this video you will know how to embed other sites into your own site. iframes enable developers to integrate other html pages directly into html pages, how cool is that ?

Video Transcript

00:00Welcome to session 5 of our HTML training for Ben and his mom,
00:06-Hi everybody!
00:07So today we're going to talk about something that's called iFrame
00:10It's not used as commonly today as it used to be used in the past
00:14but still it's very important tag to know and we'll start with that tag
00:17It's called 'iframe' . The iframe enables you basically to bake inside of an iframe the content of a different site
00:29The way you do that is you set a source just like we did with the image if you recall from session 4
00:34and you just set inside of it a full path so for example we could put inside maybe 02geek.com
00:43By setting 02geek.com inside of it, if we go into a browser after we save it
00:50we'd go into a browser and click on refresh, now that we have a nice empty,
00:54oh we're still with a recap so let me grab iframe, which is our new element,
01:01and you'll see first of all that our site loaded inside of it and it's a size of small window
01:06but we can't really see anything.
01:07How about if we make this iframe bigger so we could actually see the site ?
01:11The way we do that is very similar to the way we did when we're working with images,
01:18do you remember what was the tag used for images to set its width?
01:25-width I guess -Bingo!
01:28So we're going to set its width and as we set with numbers it doesn't really matter if we put
01:32a single quotation, double quotation around it or not,
01:35so I'm going to right away just set it to be a width of 800
01:40Once I've set the width to 800 we could go and see it but how about if we did the height as well at the same time
01:45and I'll just do 800x600 and I'm going to save the width and the height
01:49Once I've done that we could go back into our browser, click on refresh and I'll see much bigger portion
01:55of the site inside of that scope so we could actually define how big we want it to be
01:59and we could even scroll inside of it, it'll look differently depending on the browser that you're working with
02:05but on the MAC you're going to have these invisible scrolls
02:08because they assume you're already familiar with the idea of scrolling
02:13That's basically the basic essence of iframe and we just created an iframe
02:17and integrated inside of it a live site from somewhere else.

Ready to Level Up Your Skills?

Join thousands of learners on 02GEEK and start your journey to becoming a coding expert today!

Enroll Now for Free!