Web Authoring Statistics: Elements and attributes

The ten elements used on the most pages, and the twenty attributes that the most pages use with those elements:

head, html, title, body (bgcolor), a (href, target), img (src, width, height, border, alt), meta (content, http-equiv, name), br, table (border, width, cellspacing, cellpadding), and td (width, valign, align, colspan, height).

Most people (roughly 98%) include head, html, title and body elements. This is somewhat ironic, since three of those four elements are optional in HTML. It's interesting to see that most pages have a title, though.

The most-used element other than those four is the a element. Almost all pages that have an a element specify the href attribute on an a element somewhere, and more than half of pages use the target attribute on the a element somewhere.

The next most used element is the img element, with three quarters of all pages using the deprecated border attribute on at least one of img element, and around 24% of pages that use img elements not specifing alt attributes on any of their images.

The next most-frequently-featured element is meta, followed by br. The img, meta and br elements are each present on roughly the same number of pages.

The table element, along with td and tr (not shown above), are the ninth, tenth, and eleventh most frequently used elements respectively.

It seems most pages use presentational attributes: the fourth most used attribute across all elements is the table element's border attribute, followed by the height and width attributes on img, followed by <table width="">, <table cellspacing="">, <img border="">, and <table cellpadding="">. Interestingly, though, the most frequently used attribute on the body element (namely bgcolor) is only used on around half of pages, with all the other presentational attributes on body being used even less. One possible explanation is that on average, colors are mostly done using CSS, while layout is mostly done using HTML tables.