- What versions of HTML/XHTML do respondents use?
- How often do respondents validate their markup
- What doctypes do respondents declare?
- Tables finally out the window?
- Presentational HTML
- Extended Semantics
The heart of any web site or application is its markup, and at the forefront of the movement toward a standards based web has been promoting a number of practices in markup. These include
- the use of valid HTML or XHTML
- the use of appropriate semantic markup
- avoiding the use of presentational markup
In this section we asked several questions to attempt to get a better understanding of common current practice in relation to this area of web design and development.
Given that this survey asked developers what their practices are, there’s the chance that they’ll provide answers about what they think they should be doing, rather than what they actually are doing, even though it is an anonymous survey. Verifying how closely the responses match the actual practices by developers would in any case be difficult.
What versions of HTML/XHTML do respondents use?
In terms of markup languages, 6% of respondents use HTML exclusively, while 42% use XHTML exclusively. A further 16% use predominantly HTML, while 30% use predominantly XHTML – making an overwhelming ratio of around 4:1 XHTML to HTML use by respondents. This is surprisingly high, given the debates which still take place about the benefits or otherwise of XHTML over HTML. At the very least this indicates that developers feel they should on the whole be using XHTML. The implications for HTML5’s goal of having both HTML and XHTML versions of that language are interesting. If a significant majority of the respondents to this survey, who are much more likely to be early adopters of HTML5 are focussing their efforts on XHTML, is there sufficient benefit for the effort of maintaining both HTML and XHTML versions of HTML5?
Interestingly, while there have been a small number of high profile uses of HTML5 to date, only one of all the respondents made reference to using HTML5 – replying they use
Mostly XHTML, sometimes a subset of HTML5
Although, in a later question regarding doctypes, 1.3% of respondents say they declare a HTML5 doctype.
|Which type of markup do you use?|
|Mostly HTML, sometimes XHTML||196||15.88%|
|Mostly XHTML, sometimes HTML||367||29.74%|
How often do respondents validate their markup
Time and again objective studies of real world web sites finds that only a minority validate, and that in many cases, the failure to validate is not trivial. In this survey, we asked developers not whether they validate, but how often. Only 3% replied never, while 37% replied always, 33% frequently, and 22% sometimes. This indicates at least that respondents understand the importance of validating.
|How often do you validate your markup?|
What doctypes do respondents declare?
An important aspect of current best practice is the declaration of a doctype to indicate which version of HTML or XHTML the web site uses.
Less than 2% of respondents indicated they don’t use doctypes, with XHTML 1.01 transitional being the most declared at 34%, closely followed by XHTML 1.1 Strict at 31%.
Despite the answer to the previous question, 1.3% of respondents (16 in total) declare the HTML5 doctype – making the use of this doctype nearly as common as the use of no doctype at all.
It’s interesting but perhaps not surprising to see the use of frames almost non-existent, with about 1/3 of 1% of respondents declaring a frameset declaration.
Also interesting to see that 4.3% of all respondents declare XHTML 1.1 doctypes.
Once again, it must be emphasized that the profile of our respondents would not match that of the “typical” web professional, but it is instructive that these early adopters are definitely well on the way to using strict versions of XHTML for their markup. Strict versions of these languages essentially avoid any presentational elements and attributes of the languages.
For a comparison with real world results, Opera’s MAMA project found 61% of doctypes were some form of HTML4, 33% XHTML 1.0 and only 1.2% XHTML 1.1. Around 3.5% were frameset (as opposed to .3%), 6% strict (40%), and 83% transitional (45%).
|Which doctype do you typically declare for your pages?|
|HTML 4.01 strict||106||8.59%|
|HTML 4.01 transitional||142||11.51%|
|HTML 4.01 frameset||3||0.24%|
|XHTML 1.01 strict||384||31.12%|
|XHTML 1.01 transitional||425||34.44%|
|XHTML 1.01 frameset||1||0.08%|
Tables finally out the window?
While it’s still the cause of some lingering controversy, one of the trends of the last decade, accelerating in the last few years, has been the erosion of the use of the table element for page layout. While 85% of respondents answer “no” as to whether they use tables for page layout, over 10% of even the kind of respondents to this survey continue to use table based layouts, despite the widespread belief that avoiding such layouts is current best practice.
|Do you use tables for layout?|
In a related question, only 30% of respondents replied that they used no presentational HTML. The width and height attributes at 23% and 19% are still the most widely used presentational HTML – a throwback to the days of slower networks and browsers when adding these attributes to image elements helped browsers layout pages before images had been downloaded and their dimensions could be calculated. The border attribute is also still widely used – most likely for images inside link elements. By default in earlier browsers images inside links were styled with a blue border that was most commonly supressed using the border attribute. 10% of developers still use the center element, reflecting perhaps some ongoing confusion about the ways in which CSS can be used to center text (text-align: center), or blocks inside their parent elements (left and right margins of “auto”).
It’s both gratifying, but still a little concerning that nearly 6% of respondents use the font element, and 18% and 15% of respondents respectively still use the b and i elements.
So, it’s clear that presentational HTML is on the wane, but with up to nearly quarter of respondents using some form of presentational HTML, we’ll be seeing it’s use for some time yet it would appear.
|If you use any of the following HTML tags or properties, please mark them:|
The last two questions in this section aimed to see the extent to which respondents are using “semantic” technologies such as microformats and RDFa in their markup.
Microformats have been around in one form or another since 2003, and build on underlying ideas and practices in markup which go back quite a bit further. RDFa is a much more recent technology. Microformats and RDFa differ in a number of important ways, not least that while RDFa is a W3C “standard”, microformats work entirely within the framework of existing HTML standards, and are developed outside the auspices of a recognized organization like the IETF or W3C.
Over a third of respondents answered that they do use microformats in their markup – a surprisingly high number for even such a sample as this. A little under 20% answered “what are microformats”, giving around 80% awareness of the technology.
Not surprisingly, only about a tenth as many respondents answered that they use RDFa (3.4%), and nearly half (44%) that they didn’t know what RDFa is.
After several years of advocacy and development by a reasonably small but diligent and high profile community, microformats seem to be established among early adopters. While it is early days, RDFa will require it would seem, a similar community and effort to become equally established.
|Do you use microformats in your markup?|
|What are microformats?||231||18.72%|
|Do you use RDFa in your markup?|
Next, we’ll see how respondents are using CSS and other presentational technologies.