Web Design Stuff
HTML Tutorials    CSS Tutorials    Web Hosting   Resources
Create a Web Page 101
Making Web Pages Intro What is a Web Page? Why Make a Web Page? The History of HTML Learn HTML or XHTML?
Basic HTML
Basic HTML Tutorials Basic HTML Necessities How to Make a Web Page How to Edit a Web Page The Basics of HTML Tags Basic HTML Page Structure HTML Attributes
HTML Font Codes
HTML Font Codes Intro HTML Font Color Codes HTML Font Size Codes HTML Font Style Codes HTML Bold/Italic Codes Combining Font Codes
Formatting Text
Formatting Text Intro Making Paragraphs Miscellaneous Formatting Headings & Subheadings Creating Hyperlinks
Using Graphics
Using Graphics on the Web Add Graphics to Your Pages Graphics and Accessibility How to Align Graphics Page Color & Background Graphics as Hyperlinks Horizontal Rules
Creating Tables
HTML Tables Tutorials HTML Table Fundamentals Background & Border Color Table Frames & Rules Table Width and Alignment Cells 1 -Space & Alignment Cells 2 -Row Column Span Cells 3 -Width & Height
Making Lists
HTML Lists Tutorials Bulleted Lists Numbered Lists Definition Lists
HTML Frames
HTML Frames Tutorials Using Frames for Layout Advanced Frame Layouts Putting Hyperlinks in Frames Frame Border Width Color, Margin and Control Problems with Frames SmartFrames: A Solution SSI: An Alternative to Frames
Web Page Forms
Making Feedback Forms A Simple Feedback Form Installing NMS FormMail Debugging Your Setup My Web Host is Out to Lunch User Input Components Text Fields Checkboxes & Radio Buttons Dropdown Menus Push Buttons Layout and Presentation
Basic CSS
Basic CSS Tutorials What is CSS? Why You Should Use CSS How to Use CSS Inline Styles Embedded Style Sheets External Style Sheets Class Selectors ID Selectors Combining Selectors
CSS Properties
CSS Properties Intro Font Styles Width, Height & Spacing Borders Backgrounds Position Float & Alignment Hyperlinks
All About Web Hosting
Hosting Your Own Website What is a Web Host? Your Website's Home Page Building a Website Offline About Free Web Hosting Best Free Web Hosting Commercial Web Hosting How to Get a Domain Name Ecommerce Web Hosting Web Hosting Terminology
Free Web Design Tools
Best Free Website Tools Best Free Text Editors Best Free Graphics Editors Free Website Analysis Tools
Setting Up HTML Kit
HTML Kit Introduction How to install HTML Kit Screenshot Breakdown Basic Configuration Overall Appearance Shortcuts and Startup Editing Window Customizing Toolbars Using the Favorites Tab Making a New Actions Bar Odds and Ends
Free Templates
Free Website Templates Two Column Fixed Width Three Column Liquid Layout Miscellaneous Templates Dynamic Menu Effects Two Column Experimental Terms of Use About These Templates
Website Templates Help
Getting Started Template Zip File Download How to Edit Your Template What to Edit in the HTML How to Add Your Logo Making a Website
Web Design Tips
Web Design Basics Tables vs. Tableless Using Tables for Layout Example Table Layouts World's Crappiest Web Page
Twitter Backgrounds
Twitter Backgrounds Intro Cool Twitter Backgrounds Cool Twitter Backgrounds 2 Plain Twitter Backgrounds Dark Twitter Backgrounds Best Twitter Backgrounds Cute Twitter Backgrounds Music Twitter Backgrounds Music Twitter Backgrounds 2 Twitter Backgrounds 101 TERMS OF USE
All About Web Browsers
What is a Web Browser? Mozilla Firefox Internet Explorer Opera How to Set Up Firefox Top 5 Firefox Extensions
 
Contact
Post Some Feedback Send Me An Email Iron Spider Blog About Iron Spider... Site Conventions
 
 
 

 

Advanced Frame Layouts

 
Okay so you got the basics about making frames down and we've examined some simple layouts using either two framed columns or two framed rows. Now let's move on to an advanced frame layout that uses both rows and columns.

In the following example, we'll start out by making a frame layout that sets up two rows:
  1. A top row that will act as the web page header and will always remain within the browser viewport.
  2. A bottom row that will be further split into two framed columns. The column on the left will contain the site menu and the column on the right will be the content area.
Once again, we'll use the first four chapters of H. G. Wells' War of the Worlds as the content. Here's what it looks like.

Now let's slap together the HTML coding to create it. It will require four HTML documents: one frameset document and three frame source documents.

We'll start with the frameset document...


<html>

<head>
<title>HTML Frames - An Advanced Frame Layout</title>
</head>

<frameset rows="20%,80%">

<frame src="header.htm">

<frameset cols="25%,75%">
<frame src="menu_adv.htm" name="menu">
<frame src="chapter1.htm" name="content">
</frameset>


</frameset>

</html>



Okay since there's alot going on up there, I've specially color-coded the HTML source to help you better understand what's going on. Here's the lowdown:

  • The outer <frameset>...</frameset> tags act as a container for everything else and use the rows="20%,80%" attribute/value pair to split the page horizontally into two rows: a top row that spans 20% of the full height of the browser viewport and a bottom row that spans the remaining 80%.
  • The first <frame> tag uses the src="header.htm" attribute/value pair to load the header.htm file into the top row. It's unlikely that a hyperlink will target this frame to load a new page so the name attribute is omitted.
  • A second <frame> tag that would normally be used to load a file into the bottom row is omitted and, in its place, we use an inner or nested set of <frameset>...</frameset> tags. This nested frameset uses the cols="25%,75%" attribute/value pair to split the bottom row into two columns: a left column that spans 25% of the full width of the browser viewport and a right column that spans the remaining 75%.
  • The two <frame> tags inside the nested frameset each use the src attribute to load menu_adv.htm and content1.htm into the left and right columns respectively. The name attribute is used in each to permit hyperlinks to target the frame.
Essentially any <frame> tag in a frameset document may be replaced by a new set of <frameset>...</frameset> tags. This nested frameset then splits the frame it represents into more framed sections.

Here's links to the three frame source documents used in our advanced frame layout. The links will display the pages outside of their frameset to allow you to study the source code of each (after clicking on the link, click on View » Source in your browser):

header.htm (The frameset loads this document into the top row.)
menu_adv.htm (The frameset loads this document into the left column of the bottom row.)
chapter1.htm (The frameset loads this document into the right column of the bottom row.)

Inline Frames


You can actually create a little framed section right in the middle of a standard web page and have it load and display a separate html document inside. This is known as an inline frame and it is easily created using the <iframe>...</iframe> tags.

Here's an inline frame displaying chapter 1 of H. G. Wells War of the Worlds:



As you can see it performs just like a mini web page (complete with scroll bars).

Here's the source code used to create it:


<iframe src="chapter1.htm" name="subwindow" width="400" height="200"></iframe>


The <iframe> start tag requires at least the src attribute and can also use other attributes to enhance the inline frame's usability and appearance. These are outlined below:
  • src="file name" ~ Use the src attribute to specify which HTML document is to be loaded into the inline frame. The value of the src attribute can be just the file name (relative addressing) or a full-blown URL (absolute addressing).
  • name="any name" ~ Use the name attribute to act as a target for hyperlinks to use to load other documents into the inline frame. (See Creating Hyperlinks for Frames for more information.)
  • width="percentage or pixels" ~ Using the width attribute, you can explicitly set the width of your inline frame. You may define either a fixed width in pixels or a relative width which will size your inline frame according to a percentage of the available space (typically the entire width of your web page). Hence a width="400" attribute/value pair will set the width of your inline frame to 400 pixels. A width="50%" attribute/value pair will set the width to 50% of the available space.
  • height="percentage or pixels" ~ Using the height attribute, you can explicitly set the height of your inline frame. You may define either a fixed height in pixels or a relative height which will size your inline frame according to a percentage of the available space (typically the entire height of your web page). Hence a height="200" attribute/value pair will set the height of your inline frame to 200 pixels. A height="50%" attribute/value pair will set the height to 50% of the available space. (NOTE: It'll probably be easier to just use pixels to set the height.)

*   *   *


Okay so now that we know all about basic and advanced frame layouts, let's learn how to create hyperlinks in frames...





Best Free Stuff
for webmasters

Free Text Editors
Free Graphics Editors
Website Analysis Tools
Free Website Templates

See also:

Best Free Web Hosting

 

If you need a .COM web address, you can get one quick and easy at...

www.GoDaddy.com
<~ BACK TOP NEXT ~>
 
HTML Tutorials |  CSS Tutorials |  Web Hosting |  Domain Names |  Web Design Resources
Iron Spider © Copyright 2004-2011 Robert Darrell