Advanced HTML frames

Following on from 'Introduction to HTML frames', we look at some frame properties that can change the look and functionality of your pages.

Borders


If you don't insert a border reference in the FRAMESET command, a default border will be inserted that is visible between the two display HTML pages. People usually don't want it to be obvious that they are using framed pages and remove the default border by inserting something similar to the following code:

<FRAMESET rows="87%,* " border="0">

There may be instances when a border of a given pixel value and colour is desired. This is done using a combination of both the border and bordercolor properties.

<FRAMESET rows="87%,* " border="5" bordercolor="black">

Scrollbars


With frames, scrollbars may be visible (and adaptable) with each display HTML page that occurs on the screen. If not specified otherwise, scrollbars will automatically appear if the content of the HTML page is larger than the framed size allocated to it. This is the same as scripting scrolling="auto".
There are three values applicable with scrolling (insertable into the frame instances): SCROLLING="auto|yes|no".

<FRAME src="top.html" scrolling="yes">

As indicated, auto is the default property, yes will force scrollbars to show in both horizontal and vertical positions on that frame - even when they are not needed - and no will force them to never show, even if it means the entire content of the HTML page cannot be accessed.

Noresize


If you are looking at a framed page, there is a chance you can change the size of the display for each HTML page by placing your mouse over the border, and dragging it out to a desired position. By default, all frames are resizable.

However, a lot of developers don't want viewers to be able to change the site design in this way. By inserting 'noresize' within the frame command, they force the borders to stay in the same positions - with resizing no longer possible by the user.

<FRAME src="bottom.html" NORESIZE>

NoFrames


This is used to display alternative content for the user when their browser does not support frames. FRAMESETs are ignored by non-capable browsers. Similarly, data between the NOFRAMES command is ignored by browsers that do support frames.

<HTML>
<HEAD><TITLE>Controller</TITLE></HEAD>
<FRAMESET rows="87%,*">
   <FRAME src="top.html" >
   <FRAME src="bottom.html" >
</FRAMESET>
<BODY>
<NOFRAMES>Your browser doesn't support frames</NOFRAMES>
</BODY>
</HTML>

Nested Framesets


Sometimes, not all pages within a controller frame are to display row-wise or all in columns. To mix the rows and columns together, use a frameset command within an existing frameset. If the top left corner of your page were to be occupied by a document extending across the length of the browser, the first frameset would use rows; otherwise, columns.

Specifying Targets


Often when designing pages with frames, one of the display pages may also contain a navigational menu.

Using the displayed graphic as an example, imagine there is a menu in green.html. When you click on a link from here, you want it to open into the space occupied by orange.html. How do you make this happen?

1. First 'name' all individual frames into which you may want links to open

<FRAME src="orangepage.html" name="Orange">

2. In the document containing the link, use target to specify into which frame the link will go. This example opens the PC World home page in the frame that is presently taken by orangepage.html

<A href="http://www.pcworld.idg.com.au" target="Orange">PC World</a>

Additionally, there are two 'built-in' targets that the computer recognises. Here, I have described what would happen if you were to replace target="Orange" with each instance:

target="_blank" will open PC World in a new and separate browser window.

target="_top" will replace the entire framed page with the contents of PC World.

Join the newsletter!

Error: Please check your email address.
Rocket to Success - Your 10 Tips for Smarter ERP System Selection
Keep up with the latest tech news, reviews and previews by subscribing to the Good Gear Guide newsletter.

Heidi Woof

PC World
Show Comments

Most Popular Reviews

Latest Articles

Resources

PCW Evaluation Team

Ben Ramsden

Sharp PN-40TC1 Huddle Board

Brainstorming, innovation, problem solving, and negotiation have all become much more productive and valuable if people can easily collaborate in real time with minimal friction.

Sarah Ieroianni

Brother QL-820NWB Professional Label Printer

The print quality also does not disappoint, it’s clear, bold, doesn’t smudge and the text is perfectly sized.

Ratchada Dunn

Sharp PN-40TC1 Huddle Board

The Huddle Board’s built in program; Sharp Touch Viewing software allows us to easily manipulate and edit our documents (jpegs and PDFs) all at the same time on the dashboard.

George Khoury

Sharp PN-40TC1 Huddle Board

The biggest perks for me would be that it comes with easy to use and comprehensive programs that make the collaboration process a whole lot more intuitive and organic

David Coyle

Brother PocketJet PJ-773 A4 Portable Thermal Printer

I rate the printer as a 5 out of 5 stars as it has been able to fit seamlessly into my busy and mobile lifestyle.

Kurt Hegetschweiler

Brother PocketJet PJ-773 A4 Portable Thermal Printer

It’s perfect for mobile workers. Just take it out — it’s small enough to sit anywhere — turn it on, load a sheet of paper, and start printing.

Featured Content

Product Launch Showcase

Latest Jobs

Don’t have an account? Sign up here

Don't have an account? Sign up now

Forgot password?