»Dotnet Ads
»Message Boards
Message Boards
Dotnet Books
»Member Details
Register
Login
LogOut
Submit Code
Submit Jobs
Submit Projects
»Competition
Community
Winners
Prizes
Write For Us
Members
»Other Resources
Links
Dotnet Resources
|
CSS Browser Detection - The complete guideDifferent browsers, different CSS interpretations! There will be a time when you'll need to hide some CSS rules from a particular browser, or even all the CSS file! In this articles I'll try to compile all possible types of Browser detection technics and provide examples. So let's start with the easier one!
Browser detection for Netscape
Netscape 4 is probably the dumbest browser when it comes to CSS support, extremely limited and many times erroneous! As the browser's market share of Netscape is below 0.5% it became natural to hide the CSS file from it! The method used for this is the import directive that will make the browser to display a version of the site completely without CSS.
Here's the directive you have to call: (style type="text/css")@import url(wise-designscom.css);(/style); Browser Detection for IE Mac computers
This browser "died" when Microsoft announced there would be no
more updated versions of it. Now this browser fell in desuse and there are a wide range of CSS technics that IE/Mac doesn't interpret well! Therefore many webmasters started to code their CSS sites so that they would work correctly on this browsers. Contrary to Netscape users, these weren't neglected.
The hide technic:
/* Hide from IE-Mac */ #header {padding-bottom:3em} #footer {padding-top:1.5em} /* End hide */
IE/Mac won't see these commands but will display the content even without those rules! Now... if you have a specific area of your site that isn't vital to your visitors you can just hide it completely from this browser without having the trouble to even try and make it look better within the possible! Here's how:
#noiemac {display: none}
/* Hide from IE-Mac */ #noiemac {display: block} /* End hide */
The first rule hides it all from IE/Mac (e.g content to hide here!
|