Handling browser differences

There are fewer portability problems with HTML 4.01 Strict than with XHTML, so that's what a lot of authors use. These days you have to send XHTML as text/html anyway so you don't get the advantages that xhtml could someday provide. When IE8 comes out and has replaced IE7 and IE6 in the field, then you may be able to generally send xhtml as 'xhtml+xml', permitting use of a real XML parser in the client. Until then, XHTML is still handled as tag soup, not XML.

Rails works fine with HTML 4.01 Strict, even though it occasionally produces trailing slashes to close tags (like link tags).

See also http://www.hixie.ch/advocacy/xhtml.

Using a template language other than erb might give us a point of control that will allow us to make changes automatically. Such as HAML, Markaby, or Malline.

In any case, in the controller and the layout, the hash request.env has a name-value pair like this: HTTP_USER_AGENT => 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv: Gecko/20071025 Firefox/'

For IE it would be different. You can display this string on a test page with: <p> HTTP_USER_AGENT: <%= request.env["HTTP_USER_AGENT"] %></p> And figure out how to parse it. Or you could dump it using logger. Then write a method to return the header code you like.

There is also an request.env["HTTP_ACCEPT"], which includes weird but interesting stuff.