Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member

Introducing frames

From: XHTML and HTML Essential Training

Video: Introducing frames

Frames in XHTML and HTML are a way of displaying multiple pages within one page. In other words, this is a frames document and it has different areas and each of these areas has a separate XHTML page being displayed in it. When I click on the links here in the menu side, on Info, it shows me the information page here in the big open part of the frames and then Contact, it goes in this frame here, in the big frame. Each of these that I click on is going to show up there in that frame.

Introducing frames

Frames in XHTML and HTML are a way of displaying multiple pages within one page. In other words, this is a frames document and it has different areas and each of these areas has a separate XHTML page being displayed in it. When I click on the links here in the menu side, on Info, it shows me the information page here in the big open part of the frames and then Contact, it goes in this frame here, in the big frame. Each of these that I click on is going to show up there in that frame.

If I open one of them by itself, in other words, here is the Info here, company information goes here. If I right-click on this link and say Open Link in New Tab, then it will show that Info page in a tab all by itself and that's what it is here. That's a normal HTML file. So, if we look at this in the Editor, here's our frames document and I brought up the nav document here too. This is the navigation document on the left-hand side. You can see it's a normal HTML file and it's just got that unordered list with all of the links in it, just like you saw there in the browser.

So that's this document here. It's just a normal HTML file or rather an XHTML file in this case that is simply displayed in this frame. So, let's look at how this works in the frames document. This is frames document and you'll notice that it uses a different DOCTYPE, a different DTD, a Document Type Definition. It uses the frameset one. So the frameset DOCTYPE has these frameset tags available. So framesets have frameset tag and it has the frame tag. Now the frameset tag is a container, just like any other container, you see it's got the begin tag here and it's got end tag there.

The frame tag is not a container, so it has the shorthand here for not being a container and not having a separate end tag. The frameset contains frames and it can also contain other framesets. So this frameset here is contained within this frameset here. The frameset can also contain a no frames part, so here is noframes and there is the end tag for noframes. It has a body and a normal XHTML document within it. That gets displayed if it's displayed on a device or on a browser that does not support frames.

So that noframes part if what would display if the browser looking at the page does not support frames. So here is the frameset tag and you'll notice that it has columns attribute, cols. It's short for columns. So that's for vertical divisions, as you can see the comment here. This is an XHTML comment. I'm just going to cover this real quickly here. XHTML comments, just like HTML comments, they have an opening angle bracket and an exclamation point and two dashes and a space.

That all delimits the beginning of the comment. The space is required; you have to have the space. And then at the end of the comment, it has a space and two dashes and a closing angle bracket. That makes a comment. This does not get interpreted by the browser. It doesn't get displayed on the page. It's just a comment so that we can help to understand the code. So this comment says cols for vertical divisions. I put these things in to help myself remember, as much as anybody else, because I don't use frames very often, so I want to remember how they work.

So here's the frameset for the columns and it has a number here, 130,*. We'll get back to that in a moment. Within this frameset, there is a frame that has that navigation on the left-hand side that we saw in the browser. Then there is another frameset. This one says rows, this is for horizontal division. It's got a number here and an asterisk. So, this frameset is for rows. So looking at it on the browser, the first frameset is the column, so it has this one and it has this one, which is another frameset. So, it has this frame and it has this frameset that's divided horizontally.

The second frameset has the row, so it has this horizontal one here and that horizontal one there. Going back to the document, let's look at those numbers and see what those mean. I bet you can figure out by this time. 130 is the number of pixels for the first division and the frameset and then the asterisk means use up the rest of the space, divide it equally amongst whatever frames are left. So in this case we just have two, we have the one, which is the nav.html, and so that has that menu in it and that is 130 pixels wide and it's vertical.

Then the next one is this frameset, which takes up the rest of the space. So, if we look at it again in the browser, you see here is the 130 pixels and there is the nav.html. If I right-click on that and say Show Only This Frame or Open Frame in New Tab, there it is. There is the Navigation menu and that's what's there in this column all by itself, 130 pixels wide. Then the rest of the space is divided up by this other frameset. Now going back to the XHTML, here is the frameset on the right and it says rows, 75 pixels and then an asterisk.

So, the first document is going to be 75 pixels high at the top and then the next one is going to take up the rest of the space. So we'll see here in the browser. This one here is the 75 pixels at the top and this one is taking up the rest of the space. So that's how the frames work. The frameset document sets up the space and then it specifies where all of these documents come from. So, looking again at the HTML, we have a frame here with source=content/nav.html and name=nav and then a source here for this one, it says titlebar.

This was the one at the top of the rows and source here for default content at the bottom of the rows. Now, let's take a quick look at this nav.html and this is one other feature that you need to know about frames. And notice each of these links in here, these are normal anchor tags, a href=info.html target=content. This is an attribute we haven't seen before. target=content. What this means is that this link when it's clicked on will be displayed in the frame that's named content.

We look back over here at the example. We see that we have a frame that's named content. It has name=content. This one is name=title bar. This one is name=nav. This one is name=content. So when those links are clicked on, we can get nav.html again, they will show up in the content frame. If we look at this again, the content frame is the bottom frame. I have a comment there. Remember, frameset rows = 75, *. So the first one is 75 pixels and the next one takes up the rest of the space.

So if we look at the browser, we see that this is the 75-pixel one and this is the rest-of-the-space one. So when we click on these links, they're going to show up in this frame here that's named content and that's where they show up, so that's how that works. All right? So reviewing once more, it's really very simple. We have an outer frameset and that frameset has two spaces in it. It has a frame and I have another frameset. The inner frameset has two spaces and these are horizontal; the outer ones are vertical.

The outer one is vertical because it says columns and the inner one is horizontal because it says rows. Then each of these, we have-- this one is named title bar and that takes up 75 pixels. This one is named content and that takes up the rest of the space. Then the navigation file, which is in the left frame, that targets the content frame for each of the links using the target attribute. So see, that's how it works. That is, in a nutshell, how frames work.

Show transcript

This video is part of

Image for XHTML and HTML Essential Training
XHTML and HTML Essential Training

59 video lessons · 80323 viewers

Bill Weinman
Author

 
Expand all | Collapse all
  1. 5m 10s
    1. Welcome
      1m 16s
    2. Using the exercise files
      1m 23s
    3. Choosing a text editor
      2m 31s
  2. 15m 46s
    1. Introducing HTML and XHTML
      2m 53s
    2. Understanding versions of HTML and XHTML
      2m 25s
    3. Exploring a simple XHTML page
      4m 47s
    4. Understanding the structure of an XHTML document
      2m 58s
    5. Understanding document containers
      54s
    6. Creating and using templates
      1m 49s
  3. 42m 4s
    1. Understanding how empty space is formatted in XHTML
      2m 42s
    2. Using paragraph tags
      2m 42s
    3. Aligning paragraphs
      2m 49s
    4. Understanding block-level and inline tags
      1m 24s
    5. Controlling line breaks and spaces
      5m 43s
    6. Formatting text with phrase element tags
      3m 28s
    7. Formatting text with font markup elements
      3m 24s
    8. Adding document structure with headings
      3m 25s
    9. Formatting quotations and quote marks
      2m 19s
    10. Preserving pre-formatted text
      1m 30s
    11. Selecting a typeface
      4m 33s
    12. Selecting a type size
      2m 11s
    13. Using ordered and unordered lists
      5m 54s
  4. 7m 48s
    1. Using inline images
      3m 17s
    2. Flowing text around an image
      2m 4s
    3. Breaking lines around an image
      2m 27s
  5. 22m 34s
    1. Working with hyperlinks
      7m 46s
    2. Using relative URLs
      3m 5s
    3. Specifying a base URL
      2m 4s
    4. Linking within a page using fragments
      4m 28s
    5. Creating image links
      5m 11s
  6. 22m 56s
    1. Introducing tables
      4m 37s
    2. Formatting tables with CSS
      8m 50s
    3. Aligning images with tables
      5m 7s
    4. Reviewing an alternative solution using CSS
      4m 22s
  7. 14m 31s
    1. Introducing frames
      7m 56s
    2. Hiding frame borders
      3m 15s
    3. Creating inline frames using iFrame
      3m 20s
  8. 20m 50s
    1. Introducing forms: part 1
      10m 37s
    2. Introducing forms: part 2
      7m 45s
    3. Using CGI with forms
      2m 28s
  9. 25m 42s
    1. Introducing CSS
      3m 11s
    2. Understanding levels of inheritance
      6m 10s
    3. Learning CSS syntax
      11m 23s
    4. Using units of measure in CSS
      4m 58s
  10. 1h 45m
    1. Comparing table layout and CSS layout
      1m 25s
    2. Exploring the finished web site
      2m 37s
    3. Building a document header
      8m 18s
    4. Placing a banner and a contact button
      8m 13s
    5. Laying out a main menu
      6m 55s
    6. Creating a layout template: main body area
      13m 31s
    7. Creating a layout template: sidebar area
      5m 17s
    8. Creating a layout template: footer content
      4m 46s
    9. Building a main home page: main body content
      11m 24s
    10. Building a main home page: sidebar content
      8m 52s
    11. Creating a page with a menu, graphics, and formatted links
      13m 26s
    12. Creating a page containing an ordered list
      6m 44s
    13. Creating a page containing video
      10m 45s
    14. Touring the finished site
      3m 45s
  11. 53s
    1. Goodbye
      53s

Start learning today

Get unlimited access to all courses for just $25/month.

Become a member
Sometimes @lynda teaches me how to use a program and sometimes Lynda.com changes my life forever. @JosefShutter
@lynda lynda.com is an absolute life saver when it comes to learning todays software. Definitely recommend it! #higherlearning @Michael_Caraway
@lynda The best thing online! Your database of courses is great! To the mark and very helpful. Thanks! @ru22more
Got to create something yesterday I never thought I could do. #thanks @lynda @Ngventurella
I really do love @lynda as a learning platform. Never stop learning and developing, it’s probably our greatest gift as a species! @soundslikedavid
@lynda just subscribed to lynda.com all I can say its brilliant join now trust me @ButchSamurai
@lynda is an awesome resource. The membership is priceless if you take advantage of it. @diabetic_techie
One of the best decision I made this year. Buy a 1yr subscription to @lynda @cybercaptive
guys lynda.com (@lynda) is the best. So far I’ve learned Java, principles of OO programming, and now learning about MS project @lucasmitchell
Signed back up to @lynda dot com. I’ve missed it!! Proper geeking out right now! #timetolearn #geek @JayGodbold
Share a link to this course

What are exercise files?

Exercise files are the same files the author uses in the course. Save time by downloading the author's files instead of setting up your own files, and learn by following along with the instructor.

Can I take this course without the exercise files?

Yes! If you decide you would like the exercise files later, you can upgrade to a premium account any time.

Become a member Download sample files See plans and pricing

Please wait... please wait ...
Upgrade to get access to exercise files.

Exercise files video

How to use exercise files.

Learn by watching, listening, and doing, Exercise files are the same files the author uses in the course, so you can download them and follow along Premium memberships include access to all exercise files in the library.


Exercise files

Exercise files video

How to use exercise files.

For additional information on downloading and using exercise files, watch our instructional video or read the instructions in the FAQ.

This course includes free exercise files, so you can practice while you watch the course. To access all the exercise files in our library, become a Premium Member.

Join now "Already a member? Log in

Are you sure you want to mark all the videos in this course as unwatched?

This will not affect your course history, your reports, or your certificates of completion for this course.


Mark all as unwatched Cancel

Congratulations

You have completed XHTML and HTML Essential Training.

Return to your organization's learning portal to continue training, or close this page.


OK
Become a member to add this course to a playlist

Join today and get unlimited access to the entire library of video courses—and create as many playlists as you like.

Get started

Already a member?

Become a member to like this course.

Join today and get unlimited access to the entire library of video courses.

Get started

Already a member?

Exercise files

Learn by watching, listening, and doing! Exercise files are the same files the author uses in the course, so you can download them and follow along. Exercise files are available with all Premium memberships. Learn more

Get started

Already a Premium member?

Exercise files video

How to use exercise files.

Ask a question

Thanks for contacting us.
You’ll hear from our Customer Service team within 24 hours.

Please enter the text shown below:

The classic layout automatically defaults to the latest Flash Player.

To choose a different player, hold the cursor over your name at the top right of any lynda.com page and choose Site preferencesfrom the dropdown menu.

Continue to classic layout Stay on new layout
Exercise files

Access exercise files from a button right under the course name.

Mark videos as unwatched

Remove icons showing you already watched videos if you want to start over.

Control your viewing experience

Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.

Interactive transcripts

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.

Are you sure you want to delete this note?

No

Your file was successfully uploaded.

Thanks for signing up.

We’ll send you a confirmation email shortly.


Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

Keep up with news, tips, and latest courses with emails from lynda.com.

Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

   
submit Lightbox submit clicked
Terms and conditions of use

We've updated our terms and conditions (now called terms of service).Go
Review and accept our updated terms of service.