Labels

Powered by Blogger.

Free HTML Software

Free HTML Software
Free HTML Software

Sunday 1 December 2013

HTML - Frames, Frames - A Generic Frame Page,

HTML - Frames

Frames allow for multiple .html documents to be displayed inside of one browser window at a time.  This means that one page has no content on it, but rather tells the browser which web pages you would like to open. With the addition of CSS and PHP, frames have become outdated, but if you wish to use them, read on.

Frames - A Generic Frame Page

Frames are most typically used to have a menu in one frame, and content in another frame. When someone clicks a link on the menu, that link is then opened in the content page. Here is a classic example of a basic "index" frameset with a menu on the left and content on the right.

HTML Code:

<html>
  <body>
    <frameset cols="30%,*">
      <frame src="menu.html">
      <frame src="content.html">
    </frameset>
  </body>
</html>

Frame Set:

Here's the example: Frame Index
  • frameset - The parent tag that defines the characteristics of this frames page. Individual frames are defined inside it.
  • frameset cols="#%, *" - The width that each frame will have. In the above example, we chose the menu (the 1st column) to be 30% of the total page and used a "*", which means the content (the 2nd column) will use the remaining width for itself (70%).
  • frame src="" - The URL of the web page to load into the frame.
A good rule of thumb is to call the page which contains this frame information "index.html", as that is typically a site's main page.

0 comments:

Post a Comment