Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Can you use php (or any script) to dynamically load a style sheet for browser compati
Old 01-08-2008, 12:24 PM Can you use php (or any script) to dynamically load a style sheet for browser compati
Junior Talker

Posts: 2
Trades: 0
I'm new to coding so this may be a stupid question but I have three different style sheets for my website. Each one shows the presentation perfectly for it's intended browser. I'd like to know if it's possible to do a browser detection and upload the appropriate style sheet for the compatible browser. If not, how do you guys do it? Where do you put the alternate pages?

ps (since this question could fall under css, php, and probably javascript I've posted it in the posts that are relevant...in case you see it more than once.)
talan3000 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 01-08-2008, 03:13 PM Re: Can you use php (or any script) to dynamically load a style sheet for browser com
Skilled Talker

Posts: 59
Name: Dan
Trades: 0
You can use the php HTTP_USER_AGENT to get the browser version, it should be a fairly simple task to then create an if statement to load the correct stylesheet.

Although I would advise against it if at all possible as you'll be needing to maintain 3 seperate style sheets (or sets of style sheets) which could become a chore in future.
Monkey Do is offline
Reply With Quote
View Public Profile
 
Old 01-08-2008, 03:19 PM Re: Can you use php (or any script) to dynamically load a style sheet for browser com
Average Talker

Posts: 29
Name: Jean
Trades: 0
Hi,

I think you'd better use a simple css file for most browsers, and the conditionnal comment technique for ie6/7 corrections.
MarvinLeRouge is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Can you use php (or any script) to dynamically load a style sheet for browser compati
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.11232 seconds with 12 queries