spacer

Webref WebRef   Sitemap · Experts · Tools · Services · Newsletters · About i.com

home / experts / html / tutorials / 24 / 1

index123456789

Tutorial 24: Fixing Frames with Fixed Positioning

Developer News
MicrosoftÂ’s Automated Agent: Can We Talk?
Borland Finally Sells CodeGear
Red Hat Heads For The JON 2.0

How fixed positioning works

In Tutorials 14 and 15 I introduced you to the horrible world of HTML frames. A great part of these tutorials was devoted to explaining the trouble with frames. The conclusion was that although you can use some very dirty hacks to work around some of these problems, these hacks usually add more problems of their own.

Fixed positioning is a feature introduced in CSS2. fixed is a value of the position property that I introduced you to in Tutorial 18. So far, we have seen how you can use the absolute and relative values for this property to create complex layouts for your documents.

The fixed value works the same way as the absolute value, with one notable difference: The positioned block's containing block is defined by the viewport. You will remember that an absolutely positioned block is removed from the normal document flow and positioned relative to either the canvas or its nearest positioned ancestor element.

Note the difference (in CSS terms) between the canvas and the viewport. The canvas is a large flat space on which the document is rendered, and the viewport is the bit in your browser's window where the document appears. If the canvas is bigger than the viewport, only a part of the canvas will be visible at any time, and browser will usually allow you to scroll around the document using a scroll bar or something similar.

With fixed positioning, you can take an element and position it not just outside the document flow, but outside the canvas, and simply attach it to the viewport. This will mean that the element will not scroll with the rest of the document, but remain visible all the time. This effect is useful for things like a list of navigational links or a table of contents, and generally anything that people have used frames for so far.

However, before we go on to an example of how this is done, let's take a look at how this property is supported in various browsers.

index123456789

Next Page...

http://www.internet.com/



JupiterOnlineMedia

internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info


Legal Notices, Licensing, Reprints, & Permissions, Privacy Policy.

Advertise | Newsletters | Tech Jobs | Shopping | E-mail Offers

Solutions
Whitepapers and eBooks
Microsoft Article: HyperV-The Killer Feature in WinServer ‘08
Avaya Article: How to Feed Data into the Avaya Event Processor
Microsoft Article: Install What You Need with Win Server ‘08
HP eBook: Putting the Green into IT
Whitepaper: HP Integrated Citrix XenServer for HP ProLiant Servers
Intel Go Parallel Portal: Interview with C++ Guru Herb Sutter, Part 1
Intel Go Parallel Portal: Interview with C++ Guru Herb Sutter, Part 2--The Future of Concurrency
Avaya Article: Setting Up a SIP A/S Development Environment
IBM Article: How Cool Is Your Data Center?
Microsoft Article: Managing Virtual Machines with Microsoft System Center
HP eBook: Storage Networking , Part 1
Microsoft Article: Solving Data Center Complexity with Microsoft System Center Configuration Manager 2007
MORE WHITEPAPERS, EBOOKS, AND ARTICLES
Webcasts
Intel Video: Are Multi-core Processors Here to Stay?
On-Demand Webcast: Five Virtualization Trends to Watch
HP Video: Page Cost Calculator
Intel Video: APIs for Parallel Programming
HP Webcast: Storage Is Changing Fast - Be Ready or Be Left Behind
Microsoft Silverlight Video: Creating Fading Controls with Expression Design and Expression Blend 2
MORE WEBCASTS, PODCASTS, AND VIDEOS
Downloads and eKits
Sun Download: Solaris 8 Migration Assistant
Sybase Download: SQL Anywhere Developer Edition
Red Gate Download: SQL Backup Pro and free DBA Best Practices eBook
Red Gate Download: SQL Compare Pro 6
Iron Speed Designer Application Generator
MORE DOWNLOADS, EKITS, AND FREE TRIALS
Tutorials and Demos
How-to-Article: Preparing for Hyper-Threading Technology and Dual Core Technology
eTouch PDF: Conquering the Tyranny of E-Mail and Word Processors
IBM Article: Collaborating in the High-Performance Workplace
HP Demo: StorageWorks EVA4400
Intel Featured Algorhythm: Intel Threading Building Blocks--The Pipeline Class
Microsoft How-to Article: Get Going with Silverlight and Windows Live
MORE TUTORIALS, DEMOS AND STEP-BY-STEP GUIDES
webref The latest from WebReference.com Browse >
Perl Pragma Primer · Implement Drag and Drop in Your Web Apps: Part 2 · How to Create an Ajax Autocomplete Text Field: Part 5
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
SQL Server 2005 Express Edition - Part 22 - Upgrading from Microsoft SQL Server Desktop Engine (MSDE) · Vyatta: Downgrades that Pay Off · NetMotion Brings Cross-Network Support to Wireless VoIP

URL: http://www.webreference.com/html/tutorial24/1.html

Produced by Stephanos Piperoglou
Created: August 24, 2000
Revised: August 29, 2000