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 PC World newsletter!

Error: Please check your email address.

Our Back to Business guide highlights the best products for you to boost your productivity at home, on the road, at the office, or in the classroom.

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 News Articles

Resources

PCW Evaluation Team

Azadeh Williams

HP OfficeJet Pro 8730

A smarter way to print for busy small business owners, combining speedy printing with scanning and copying, making it easier to produce high quality documents and images at a touch of a button.

Andrew Grant

HP OfficeJet Pro 8730

I've had a multifunction printer in the office going on 10 years now. It was a neat bit of kit back in the day -- print, copy, scan, fax -- when printing over WiFi felt a bit like magic. It’s seen better days though and an upgrade’s well overdue. This HP OfficeJet Pro 8730 looks like it ticks all the same boxes: print, copy, scan, and fax. (Really? Does anyone fax anything any more? I guess it's good to know the facility’s there, just in case.) Printing over WiFi is more-or- less standard these days.

Ed Dawson

HP OfficeJet Pro 8730

As a freelance writer who is always on the go, I like my technology to be both efficient and effective so I can do my job well. The HP OfficeJet Pro 8730 Inkjet Printer ticks all the boxes in terms of form factor, performance and user interface.

Michael Hargreaves

Windows 10 for Business / Dell XPS 13

I’d happily recommend this touchscreen laptop and Windows 10 as a great way to get serious work done at a desk or on the road.

Aysha Strobbe

Windows 10 / HP Spectre x360

Ultimately, I think the Windows 10 environment is excellent for me as it caters for so many different uses. The inclusion of the Xbox app is also great for when you need some downtime too!

Mark Escubio

Windows 10 / Lenovo Yoga 910

For me, the Xbox Play Anywhere is a great new feature as it allows you to play your current Xbox games with higher resolutions and better graphics without forking out extra cash for another copy. Although available titles are still scarce, but I’m sure it will grow in time.

Featured Content

Latest Jobs

Don’t have an account? Sign up here

Don't have an account? Sign up now

Forgot password?