2

I'm making a webpage from scratch and it needs to support as wide of a browser market share as possible. The webpage will be relatively simple, with a few ajax calls that'll populate some divs.

Which (X)HTML and CSS version should I support and should I code in Strict or Transitional mode? Which should be the earliest IE browser I should support? I'm after maximum cross-browser compatibility and consistency.

EDIT: The webpage will be for business people. The initial question assumed most of them still use IE 6, but it seems I was wrong.

Howie
  • 2,760
  • 6
  • 32
  • 60
  • 2
    why ie6 compatible http://www.ie6countdown.com/ ? –  Oct 03 '12 at 06:24
  • You can use Transitional Mode. But i dont know why people still support IE 6 :) – Murali Murugesan Oct 03 '12 at 06:26
  • hmm, I shall rephrase the question. – Howie Oct 03 '12 at 06:26
  • No amount of money is worth me tolerating a client that's still using IE6... [IE6 Has Overstayed its Welcome](http://www.idytise.com/blog/overstaying-your-welcome/) Edit: Happy to see YOUR update! I, personally, have a habit of building to the highest standards I can (currently HTML5/CSS3). Doing so properly naturally tends to yield a pretty high level of backwards compatibility, assuming you aren't relying too heavily on the newer tags and features. – Mike Oct 03 '12 at 06:31
  • @Mike, really? Let me know their details, I'll happily take the business. – David Thomas Oct 03 '12 at 06:34
  • @DavidThomas... yes really. If a client is stuck on a 10+ yr old browser then, from my experience, it's a red flag to begin with. Not worried though, since I haven't had a request like that for 2+ years (Thankfully!) – Mike Oct 03 '12 at 06:36

4 Answers4

2

I strongly suggest you to go for HTML5 even if you won't use any of the new semantic elements.

Quoting from Google Maps API:

<!DOCTYPE html>

Most current browsers will render content that is declared with this DOCTYPE in "standards mode" which means that your application should be more cross-browser compliant. The DOCTYPE is also designed to degrade gracefully; browsers that don't understand it will ignore it, and use "quirks mode" to display their content.

And if you want to work with almost any web 2.0 API, you'll have trouble with XHTML Strict / Transitional.

Declare <!DOCTYPE html> and you can feel pretty comfortable.


CSS version is not important, since there are some CSS2 properties not supported by modern browsers yet. You have to rely on sites like these to check the compatibility of each property that you think is essential to display the content:

  1. Quirks Mode
  2. Can i Use
  3. Litmus

Generally, you can simply Google "apropertyname browser support" to obtain very useful informations.

Keep in mind that websites don't have to look exactly the same in every browser, your main goal is to make the content readable and available at "any" condition.


Speaking of IE, check yourself the usage stats Updated to Aug/Sept 2012:

  • StatCounter IE6: notevenlisted, IE7: 1.12%, IE8: 13.08%
  • W3Counter IE6: notevenlisted, IE7: 4.60%, IE8: 10.19%
  • Wikimedia IE6: 0.99%, IE7: 3.44%, IE8: 8.46%

So at most you may worry about IE7.

You may also create a "backward-compatible" version (basically with css and javascript disabled) for those who use IE7 and below, with conditional comments. So you'll surely provide readability, then add a link to switch back to the normal version (at their own risk).

Even most of the APIs (eg Vimeo, Facebook, Google Maps) and libraries and plugins etc. don't work on IE7 anymore. Or at least they cause JavaScript errors.

Giona
  • 20,734
  • 4
  • 56
  • 68
1

Support IE8+, use

<!DOCTYPE html>
<head>
 <meta http-equiv="X-UA-Compatible" content="IE=edge" />

and get to it.

Travis J
  • 81,153
  • 41
  • 202
  • 273
1

Which (X)HTML and CSS version should I support

XHTML is more trouble then it is worth unless you are using an XML toolchain already.

HTML 4 is the latest recommendation for HTML.

HTML 5, while a draft, has some features you may with to use

and should I code in Strict or Transitional mode?

If you are using a version of HTML with Strict and Transitional variants, use Strict unless you need a particular features from Transitional (which is unlikely, browsers finished the transition to the 1996 recommendation a long time ago).

Which should be the earliest IE browser I should support?

Depends on your target audience's selection of browsers (which will change over time so any specific answer would be too localised) and budget.

and CSS

Don't pay attention to CSS version numbers. Worry about support for particular features.

I'm after maximum cross-browser compatibility and consistency.

It is the web. Aim for "good" not "identical".

Quentin
  • 914,110
  • 126
  • 1,211
  • 1,335
  • I will not use any of the HTML 5 features. I assume I'm better (or at least not worse) off using HTML 4.01 Strict? – Howie Oct 03 '12 at 06:43
0
<!--[if lt IE 9]>
<script src="http://ie7-js.googlecode.com/svn/version/2.1(beta4)/IE8.js"></script>
<![endif]-->
<script type="text/javascript" src="js/html5shiv.js" ></script>
<script type="text/javascript" src="js/html5.js" ></script>

Transitional is best. you can download shiv.js form this browser compact

also plz refer this link What does <meta http-equiv="X-UA-Compatible" content="IE=edge"> do?

Community
  • 1
  • 1