Web Hosting Talk







View Full Version : CSS questions


LT LLC
05-29-2003, 09:25 PM
As you know, there are a lot of browser compatibility problems with CSS. Is there a way I could set it up whereby the browser will automatically download a different CSS external style sheet upon detection? If so, I have the following questions:

1) What is the code that goes in the head that detects the OS/browser and then selects the correct stylesheet?

2) The following code works for me in Mac 0S9 plus ie 5.5. It doesn't seem to work in XP with ie 6.0.

Can anyone tell me how I would write it for different OS's and browsers?

body {
background-color: #A1FDD6;
font: 11px/16px Verdana, Geneva, Arial, Helvetica, sans-serif, Osaka;
color: #333333;
padding: 0px;
margin: 10px;
width: 100%;
height: 100%;
}

Thanks!

digitok
05-29-2003, 09:58 PM
Take a look at:
http://www.w3schools.com/js/js_browser.asp

This should help you out with your browser detection issues.

Rich2k
05-30-2003, 04:41 AM
What you have there will be find for all modern browsers.

Netscape 4.x and IE3 will have problems with parts of it... IE3 especially but seeing as no-one uses it anymore then don't worry.

Netscape 4 will ignore the margin and font size settings.... but then 'almost' no-one uses that anymore either... and if they do it's time to get a new pc that'll run a better browser!

NyteOwl
05-30-2003, 03:37 PM
You can structure your CSS file with a 'kludge' so that IE will behave like most everyone else. Check out the design rant at www.thenoodleincident.org

BTW, EI in Mac behaves totally difrferent to IE in Windows, even of the same version.