Start learning with our library of video tutorials taught by experts. Get started
Viewers: in countries Watching now:
In XHTML and HTML Essential Training, Bill Weinman helps designers and coders understand XHTML and HTML. In the process, Bill covers document structure, block and inline-level tags, floating images, controlling white space, phrase and font markup, and tables and frames. He even provides a good introduction to CSS. Bill offers step-by-step guidance for building a complete working web site. Exercise files accompany the course.
In this lesson we're going to talk about iFrames, which is the kind of frames that people actually use these days. The other kind of frames that we've been talking about for the rest of this chapter, those frames that divide up the screen into different areas, very few people are ctually using those anymore. You don't see them a lot on the Internet anymore. They tend to mess up the search engines and so people don't get a lot of traffic, and they also tend to mess up the users. They're hard to navigate. The back button doesn't always do what is expected to do, and so people don't like them, and they don't use them very much. The iFrame on the other hand is actually very useful, and people use them quite often.
In any event, here is the iFrame document. It's very simple. You see it uses the normal XHTML Transitional DTD. The Doctype is the normal one that we've been using. We don't have to have a special Doctype for that. It has all the normal XHTML that you might find. It's got this H1 tag, and the P tag, and all of that, and here it's got an iFrame tag, and this iFrame tag has a begin tag and an end tag, it's a block element, and it has its content wherever you want to have display for browsers that don't support the iFrame.
Then it's got a source attribute, where you specify the file, and has width and height, little bit of style information here to create that nice little border around it, and that's it. And then it pulls up this other XHTML file, iFrame-content, and this is what goes inside the box, and you see that we have that sourced with the source attribute. It tells us where to find that, and that's this file here, which is just a normal XHTML file. You'll notice it's got the normal transitional Doctype at the top, and it has a little bit of style information there , and then it has the heading iFrame Content, oh, that's the title, iFrame Content, and that doesn't actually display anywhere here, but that is required by the standard.
So we go ahead and put that in. Then it's got a body, and it's got this heading, the Standard Disclaimer is the heading, and then it has this paragraph. This product is meant for educational purposes only, blah, blah, blah, and that goes down in here. You'll notice that this is an actual frame, in an actual file. I can select with my right mouse button. I can say let's Show Only This Frame, or open it in a tab. It opens in the tab, there is the title , and there is the whole document there. So that's how you make an iFrame, you'll need to that if you need to display some disclaimer, or some legalese that you have to have in your webpage.
So you don't want to have it take up a lot of screen real estate, use the iFrame tag, and you use the source attribute , and whatever other attributes you need, and there it is. It displays in that nice little handy box with a nice little handy scroll bar, so that people will look at if they are inclined to do so.
Find answers to the most frequently asked questions about XHTML and HTML Essential Training.
Here are the FAQs that matched your search "":
Sorry, there are no matches for your search ""—to search again, type in another word or phrase and click search.
Access exercise files from a button right under the course name.
Search within course videos and transcripts, and jump right to the results.
Remove icons showing you already watched videos if you want to start over.
Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.
Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.