Home | Web Page Design Club | Web Design Video Course

Using frames - HTML code

Layout - Using Frames - HTML code

Learning how to use frames is easy once you have mastered the concept that a hyperlink can lead to a page in its own frame (TARGET="self") the default option, or in another frame in the frameset e.g.:(TARGET="main"). The best way to learn is to copy the sample code below into a text editor and save it as a .htm or .html file - for example index.htm.

Sample code

What I have shown above is a frames page that contains 4 other web pages which you would have to create.

  • page1.htm - where you could place your logo.

  • page2.htm - where you could place your header

  • page3.htm - where you could place a menu

  • page4.htm - where you could place the contents of your first page.

To create these pages just use your HTML editor and save each page with the above names e.g: page1.htm etc... or whatever you want to call them.

The most difficult part of using frames is to get the links right on the menu page. As well as specifying which page you want to link to you also have to give the link the target frame you want the page to load in. In the above example we have 4 frames, corner, header, menu and main.(you can name these whatever you want).

If you want to load a new page in the main frame your HTML link in the menu page should look like this:

If you do not specify a target for your link, it will load in the current frame by default, so if you did not specify target="main" in the above example the new page would simply replace the menu page. If you therefore have links in the main content of your frames (page4.htm in the above example) you would not need to specify any target.

 arrowdown Using Tables

web page design club

Home | About Us | Contact Us | Privacy