The Wayback Machine - https://web.archive.org/web/20090625202523/http://www.webreference.com:80/html/tutorial24/8.html


spacer

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

home / experts / html / tutorials / 24 / 8

index123456789

Tutorial 24: Fixing Frames with Fixed Positioning

Developer News
Google Going Native With Chrome
Mozilla Fixes Firefox Flaws as 3.5 Release Nears
Microsoft and Novell Still Bosom Buddies

The finishing touch

Of course, layout isn't everything when it comes to a style sheet, so I've added another bunch of rulesets to make our page look better.

BODY {
 background-color: #FFFFFF;
 color: #000000;
}
A:link { color: #8B7CFF }
A:visited { color: #483ACE }
A:active { color: #CC0000 }
H1, H2 {
 font-family: Arial, Hevetica, sans-serif;
 font-style: italic;
 font-size: 120%;
}
H1 {
 margin-top: 0;
 font-weight: bold;
}

/* Gecko doesn't inherit this */
#navigation, #intro, #news, 
   #copyright { background-color: #FFFFFF; }

#navigation P {
 text-align: center; 
 margin: 0;
}
#copyright P {
 margin: 0;
 font-size: smaller;
 text-align: right;
}

Some interesting notes on this style sheet: First of all, I have revealed a little bug in Gecko, since the fixed elements should have a transparent background, but actually look gray, so I've explicitly set their background to white (I've reported this bug, and expect it be fixed by the time Navigator 6.0 and Mozilla 1.0 are released).

Also, I've set the margins of the paragraphs in both the navigation and copyright sections to 0 so that they can fit into the 1.4em and 1.2em heights we've given them respectively, giving us a nice, compact layout. I've also set the top margins of the two H1 elements to 0 so that they sit at the very top of their frames.

Adding some stylistic touches like fonts and colors to the element's contents gives us some very pleasing results.

Acme's framed homepage on Netscape Navigator 6.0PR2
Acme's framed homepage on Netscape Navigator 6.0PR2 [Full-sized image]

index123456789

Next Page...

http://www.internet.com/

internet.commediabistro.comJusttechjobs.comGraphics.com

Search:

WebMediaBrands Corporate Info
Copyright 2009 WebMediaBrands Inc. All Rights Reserved.

Legal Notices, Licensing, Reprints, Permissions, Privacy Policy.
Advertise | Newsletters | Shopping | E-mail Offers | Freelance Jobs

webref The latest from WebReference.com Browse >
Data Filtering with PHP · Theming Your CMS Without Tearing Your Hair Out · Make Prettier URLs with Apache's Mod Rewrite
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Oracle 11g Data Guard: Grid Control Management · Virtualization, Cloud Key in Data Storage Future · Enterprise SBC Market Set to Grow 49 Percent Annually through 2013

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

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

Morty Proxy This is a proxified and sanitized view of the page, visit original site.