Recently I've been developing a website for a friends business, and making it I realised that I wouldn't be able to make one version that could work in all browsers, so I started making a few different version with different style sheets so that it would work in IE, Chrome and Mozilla.
I assumed it would be quite a simple piece of code I'd have to use to make the web page check the browser then open the specific web page, but I was wrong, I've spent hours looking around on the internet for a tutorial on how to do this, and none of them have really been helpful, so I was wondering if anyone knew of a tutorial for this particular problem or could maybe send me on the right track.
Thanks, Arthur
Java script Newcomer
Page 1 of 15 Replies - 626 Views - Last Post: 11 December 2010 - 02:55 AM
Replies To: Java script Newcomer
#2
Re: Java script Newcomer
Posted 09 December 2010 - 09:24 AM
Javascript isn't the best tool for this, as it can be disabled. If you are using a server-side language like PHP, ASP.NET, or ColdFusion, use that to check the browser.
#3
Re: Java script Newcomer
Posted 09 December 2010 - 09:46 AM
a website working in all browsers is not that complicated. first of all you need a valid HTML page (check in http://validator.w3.org/). using CSS2.1 should work in all browsers and if there are issues in IE, you can serve IE specific CSS by using conditional comments.
#4
Re: Java script Newcomer
Posted 10 December 2010 - 06:23 PM
Dormilich, on 09 December 2010 - 08:46 AM, said:
a website working in all browsers is not that complicated. first of all you need a valid HTML page (check in http://validator.w3.org/). using CSS2.1 should work in all browsers and if there are issues in IE, you can serve IE specific CSS by using conditional comments.
What's a conditional comment?
I mean what language would that be written in?
#5
Re: Java script Newcomer
Posted 11 December 2010 - 01:03 AM
a conditional comment is a special syntax of a HTML comment of IE.
#6
Re: Java script Newcomer
Posted 11 December 2010 - 02:55 AM
It's definitely not rocket science to make a site that looks the same in firefox/chrome/safari etc - or at least close enough given font changes and so forth - so your only problem should be IE, which will be solved with a separate stylesheet in a conditional comment as Dormilich suggested. Note that you will probably end up with something like this:
1 normal stylesheet
2 conditional stylesheet for IE8 overrides
3 conditional stylesheet for IE7 overrides
4 conditional stylesheet for IE6 overrides
1 normal stylesheet
2 conditional stylesheet for IE8 overrides
3 conditional stylesheet for IE7 overrides
4 conditional stylesheet for IE6 overrides
Page 1 of 1
|
|

New Topic/Question
Reply
MultiQuote










|