|
|
Paterson history |
Technical notes for web developers(1 May 2010) Reverting from XHTML to HTMLA couple of years ago there was a consensus (with a few dissenters) that XHTML was the best way forward, so I changed from writing web pages in HTML 4.01 (strict) to XHTML 1.0. All the pages on this site up to April 2010 are written in valid XHTML 1.0. Now it has been announced that development work on XHTML has ceased and no further versions will be implemented. Instead, HTML 5 is the way forward although the HTML 5 Standard is still at the draft stage and will remain there for quite a while. In the short term this has absolutely no impact on the operability or cross-browser compliance of web pages written in XHTML (which is a sub-set of HTML anyway) and it will continue to be supported in browsers for many years ahead. However, in terms of a smooth migration to the emerging HTML 5, I have decided to write all web pages from now on in HTML 4.01 (strict), so this site will become a mix of XHTML and HTML. It's a case of one step back to ensure an easier step forward in the future. Here are some links for html 5: Tweaking HTML 4.01 to be valid (draft) HTML 5Starting with the page on St. Anns (and the page you are reading now) I have reverted to HTML 4.01 and tweaked it to also validate as HTML 5, provided I 'comment out' the HTML 4.01 doctype declaration and substitute the simple <!DOCTYPE html>. This tweaking involved a couple of changes. The cellspacing attribute is valid HTML 4.01 (strict) but is obsolete in HTML 5. The CSS equivalent is border-spacing but this is not supported in older versions of Internet Explorer. Fortunately I found that border-collapse: collapse in CSS substitutes nicely for cellspacing="0" in HTML. The other tweak involved the anchor for references at the bottom of pages. Previously I used both 'name' and 'id' in the 'a' tag, for example name="ref4" id="ref4". HTML 5 warns that 'name' is obsolete and says to just use 'id', so that's what I am doing from now on. That leaves just one warning when I validate my HTML 4.01 as HTML 5, and that relates to the use of charset=ISO-8859-1 in the meta tag in the document head. I am yet to learn how HTML 5 will handle character-set encoding. The page still validates as HTML 5 with this meta tag, but it generates a warning. Cleaning up meta tagsI have decided to ditch the 'keywords' meta tag as search engines don't use them anymore. However, I need to add the 'description' meta tag as google and others will use this to display information on the page in its search results (although I don't think it improves search engine precedence). Accessibility issues—javascript, and tables for layoutAccessibility of web pages is an ongoing concern. Writing web pages in valid, compliant code maximises cross-browser compatibility, but there are other issues. I use javascript sparingly and only for non-essential tasks because about 5% of users have it turned off. I still use tables to lay out web pages, which horrifies some web purists. So why do I persist? Use of tables to lay out web pages is valid HTML, it provides a layout that is rock-solid in its rendering by the major browsers and it degrades gracefully in non CSS-enabled browsers. However, the problem is that text-readers used by the visually-impaired may not be able to make sense (or not full use) of web pages laid out in this way. Using pure CSS to achieve the same layout is straightforward and I have tried it successfully a couple of times over the years. Last time I tried, it still produced web pages that rendered slightly differently in different browsers. I intend to revisit this sometime in 2010 and this time I may ditch table layout. RSS feedsI have finally implemented RSS feeds on the site although I suspect few people will use them on a history website. I found a great introductory tutorial |