Pin Bottle Boston & Tucson Website Design
Web Design, SEO and sometimes more

Google Reader or Homepage  Add to My Yahoo!  Add to Technorati Favorites!   

Monday, January 15, 2007

The Ultimate CSS Hack Pt. 2

Until all web browsers begin to interpret CSS correctly, the CSS Hack is a necessary evil. Although the series will address Internet Explorer, Safari and Opera, Firefox hacks are simply not necessary. In short, Firefox is head and shoulders above all other browsers in terms of rendering CSS correctly, so a good rule of thumb is: Write for Firefox, hack the others.

Safari
Remember the "linear rule" we discussed in Pt. 1? If not, take a moment to refresh your memory before we continue. Using the "linear rule," Safari hacks are easy. Whenever CSS syntax includes the # sign in the exact location as shown below, Safari will ignore the entire CSS rule, and any other rules that follow after the # sign is read.

body {
background-color: black;
}

body {
background-color: white;#}


In the above example, ALL browsers other than Safari will have a white background. Because Safari ignores the second rule, it will show a black background. Pretty easy huh?

In general, Safari is pretty good with CSS compliance, but because Safari does NOT support styled forms, hacks are especially useful in this area.

Net Up: Opera
The Safe, Effective way to Move your Pages - The Ultimate CSS Hack Pt. 1 - Hi, I'm a PC and I'm a Mac - Why No Comments? - 10 Favorite Programs and Tools - Google vs. MSN and Yahoo - New Name, New Site! - Conditional Statements - Labels pt. 2 - Are you in the Game? - September 2006 - October 2006 - November 2006 - December 2006 - January 2007 - February 2007 - April 2007 - June 2007 - July 2007 - July 2008 - September 2009 - Website Design History
Website Design Awards

Theme: Day Dream by Jim Whimpey. Get a free blog at WordPress.com.
Pin Bottle Boston Website Design 2007, All Rights Reserved - Site Map