Ninjakreborn Posted May 12, 2006 Share Posted May 12, 2006 This is about php, I need to find an answer to this question, I am working with Xhtml/css, I am thinking of a work around for browser incompatibilities, is it a good idea to use PHP, to change the stylesheet based on the browser. Like I can have my default stylesheet for internet explorer, netscape, and firefox, have an alternate one for people that use opera browsers. Is this a good idea, or is it going to keep me from learning css well enough, I want to learn the best of both, I am not fully understanding the good, and bad uses for server side programming I am wondering if the use of php for this specific type of thing is a good idea or not, thanks. Quote Link to comment Share on other sites More sharing options...
Carth Posted May 12, 2006 Share Posted May 12, 2006 Well if you want to control how it looks on each browser, then it's a good idea. I don't think it will impede your learning of CSS. You'll have to write more CSS surely? And controlling output based on user input (in this case, their choice of browser), is what server side programming does best. Quote Link to comment Share on other sites More sharing options...
Ninjakreborn Posted May 12, 2006 Author Share Posted May 12, 2006 So suppose I wanted to binge. I decided that I was going to start making a stylesheet, getting it good in every browser, and window size possible, hopefully liquid design. then for instance, I made an extra style sheet, one for every single browser that didn't work before, and every screen resolution I couldn't get right with the other browsers. And suppose I used php to put this all together, would I end up purging later.To put it technically, will I end up running into a lot of issues later on down the road, when I start copying and pasting my homepage, and changing the actually content. Or will I have to do a whole lot of extra work, I am trying to find the best solution to both worlds, I have been putting a lot of thought into these kind of things that past few weeks, to strike a thin line between, Xhtml, css, php, and javascript, where i utilize all of them, for there best purposes. Quote Link to comment Share on other sites More sharing options...
AndyB Posted May 12, 2006 Share Posted May 12, 2006 The real solution is to code so that your (x)html is 100% valid and your CSS is 100% valid. Avoid any CSS alternatives that are not supported with mainstream browsers or for which there are not rock-solid workarounds (typically IE is going to require the most work). Avoid coding anything that depends on a specific browser window size. Test everything using multiple browsers, and with different text sizes chosen by the browser is time well spent.Creating a huge number of stylesheets is a losing proposition - you'll spend your life doing maintenance.Using php to switch [b]some[/b] elements of a stylesheet such as different header images for different pages is a sensible use of server-side coding. Breaking one large CSS file into components makes that a trivial exercise so that you only need to load the smaller [i]page-specific[/i] CSS file instead of a whole new CSS file.And - a helpful hint: try to use topic titles that at least give forum browsers a clue as to whether they want to read your topics. 'php' isn't very informative. Quote Link to comment Share on other sites More sharing options...
Ninjakreborn Posted May 13, 2006 Author Share Posted May 13, 2006 ok thanksso what browsers, do you suggest I test it under, I have netscape, internet explorer, opera, and firefox, but now I noticed when text sizes are changed, it still messes it up even in ie, when I change from medium, over to big font or something it messes the whole thing up, I thought accessibility and browser compatibility meant having it work in all browsers possible, with all text sizes excetera. What do you suggest. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.