Forum Moderators: open

Message Too Old, No Replies

Setting up a server to display different pages for different browsers

I have searched but can't find exact answer...

         

theadvocate

7:19 pm on Feb 6, 2004 (gmt 0)

10+ Year Member



I need to set up a site to be viewable in "all" browsers, but I don't like to lose the look I have it set for IE.

So can someone please point me in the right direction for serving up different pages depending on the user's browser?

Thanks!

DrDoc

7:50 pm on Feb 6, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



How about taking a totally different approach? Any form of browser sniffing is inevitably going to fail. Why don't you just use CSS to style your page in a cross browser consistent manner? All you need to do is test in standards compliant browsers (such as Mozilla and Opera) first, then tweak it to work in IE as well. Then just use @import to hide these styles from older (and utterly incapable) browsers.

What does this give you? A page with a look consistent in all major browsers. The other browsers get an unstyled page. No sniffing required, and no need for multiple pages.

At least that's the professional way of doing it...

theadvocate

8:15 pm on Feb 6, 2004 (gmt 0)

10+ Year Member



DrDoc,

I was just looking into this. So far I have read that you can use javascript to refer to different style sheets based on the browser type?

Sounds good to me, now I just need to figure out how...

I use CSS, but javascript is greek to me. I have cut and pasted a few javascripts into pages where needed, such as menu jumps, but that's about it.

If anyone has the javascript or HTML to post at the top of the page I would appreciate it, otherwise I will do some more searching.

Thanks for the help!

DrDoc

10:10 pm on Feb 6, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Why do you need JavaScript?
Plain CSS will do fine :)

theadvocate

11:12 pm on Feb 6, 2004 (gmt 0)

10+ Year Member



DrDoc,

CSS is better. I will look into the command for selecting different browsers.

If anyone could post it here I would appreciate it.

Thanks!