Note that iframes are available in HTML5. Frames have been phased out of HTML5 so we are looking at them under XHTML. For the examples I am covering look under XHTML and then frames. Note that iframes are available in HTML5.
<?xml version="1.0" encoding="iso-8859-1"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en" dir="ltr"> <head> <title>Header Page</title> </head> <frameset rows="50%,*"> <frame src="hdrtx.html" name="hdrtop" /> <frame src="hdrbx.html" name="hdrbottom" /> </frameset> </html> The top four lines wrapping onto the fifth are about XHTML and they say that it is using a frameset. The frameset says rows=”50%,* which means the top row uses 50% and the rest uses what is left. Within the frameset we are setting a frame for each of the rows. The top row will contain the page hdrtx.html and the bottom row will contain the page hdrbx.html. Note that each of these are entire pages that you can see at my site under frames. Then the frameset is closed. So the frameset is made up in this example of two rows each containing a page and each given a name that can be used in more advanced examples.
Here we have cols instead of rows and again each contains a page Here we have cols instead of rows and again each contains a page. When you view page source you see this code. On the next page we will view frame source of one of the pages and see the code for that page.
I am viewing the source of the page in the frame which is hdrlx.html.
You can follow which is which through the name. This is hdrtx You can follow which is which through the name. This is hdrtx.html name = “hdrtop”
See next page
The example on the previous page has three rows and the middle row is divided into two columns. First I used frameset to layout the three rows with 25%, 50%, *. In the first row I put hdrtx.html Then I made the second row a frameset with two columns so each of those columns contains a page. The left column contains hdrlx.html and the right column contains hdrrx.html. Then I closed the frameset. Note that this frameset was nested in the original framset. Next I dealt with the third row which contains hdrbx.html and then I closed the outer frameset.
Second: I want you to experiment with frames Second: I want you to experiment with frames.Try a nested frame with one row on the top and one row on the bottom and the bottom one divided into 3 columns. The frame assignment you have is to have two rows but the bottom row is divided so it has 3 columns. You can show different pages in each of the four areas or you can show the same page in each of the four areas.