Home arrow Style Sheets arrow Page 3 - Cross Browser Issues: CSS Hacks Explained, Tips, Tricks and Fixes
STYLE SHEETS

Cross Browser Issues: CSS Hacks Explained, Tips, Tricks and Fixes


Anyone who creates Cascading Style Sheets knows that Internet Explorer is a headache of a browser to build for because of the way it handles CSS. In this article, Jennifer goes into detail about how to deal with some of the most common bugs, and notes which ones may be fixed in IE 7.

Author Info:
By: Jennifer Sullivan Cassidy
Rating: 3 stars3 stars3 stars3 stars3 stars / 32
January 25, 2006
TABLE OF CONTENTS:
  1. · Cross Browser Issues: CSS Hacks Explained, Tips, Tricks and Fixes
  2. · The Use of JavaScript and CSS
  3. · Hiding CSS from Buggy Browsers
  4. · Workarounds for Internet Explorer
  5. · More Workarounds for Internet Explorer

print this article
SEARCH DEVARTICLES

TOOLS YOU CAN USE

advertisement
Cross Browser Issues: CSS Hacks Explained, Tips, Tricks and Fixes - Hiding CSS from Buggy Browsers
(Page 3 of 5 )

It may be in your best interest for several reasons, to simply hide CSS files from certain browsers.  One reason to do this would be that providing browser support for many browsers takes a lot of time, especially if you change your site often.

There are a few hacks to enable you to do this.  Here is one that basically allows you to place the CSS code that all browsers understand in your current style sheet, yet hide the more complex, separate style sheet from the browsers that don’t understand the directives contained in it, particularly IE 3 and Netscape 3:

/* CSS style sheet - hide from IE3 and Netscape 3 */

@import url(compliant_browsers.css);

Because the chances are slim that people are still using these browsers anymore, you will probably want something that deals with newer browsers:

/* CSS style sheet - hide from IE4 */

@import "compliant_browsers.css";

Or, for hiding individual properties that render oddly in IE 4 and 5:

color/*This comment is to hide this property from IE4 and IE5 */ : red

Once you’ve decided whether to use a single style sheet for your CSS design purposes, or particular ones for each browser type, or to simply hide them from outdated browsers that don’t support CSS, it’s time to look at what the workarounds may be for the browser issues we talked about.


blog comments powered by Disqus
STYLE SHEETS ARTICLES

- CSS Combinators: Working with Child Combinat...
- CSS Combinators: Using General Siblings
- Intro to CSS Combinators
- CSS Semicircles and Web Page Headers
- Drawing Circular Shapes with CSS3 and Border...
- More CSS Pagination Link Templates
- CSS Pagination Links
- Animated CSS3 Image Gallery: Advanced Transi...
- CSS3 Animated Image Gallery: Transitions
- CSS3 Properties: Fixed Heights with box-sizi...
- CSS3 Properties: Altering Strokes and 3D Eff...
- CSS3 Properties: Text-Stroke
- CSS3 Transitions: Width and Height Properties
- Creating a Drop Down Menu in CSS3
- Intro to CSS Transitions

Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 



© 2003-2012 by Developer Shed. All rights reserved. DS Cluster 9 - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials