--- url: "https://almanac.httparchive.org/en/2024/markup" titulek: "Markup | 2024 | The Web Almanac by HTTP Archive" h1: "Markup" popis: "Markup chapter of the 2024 Web Almanac covering document data (doctypes, compression, languages, HTML conformance, document size), the use of HTML elements and attributes, data attributes and social media." jazyk: "en" kanonicka: "https://almanac.httparchive.org/en/2024/markup" drobecky: ["en", "2024"] zdroj: "live" wayback_snapshot: "" stazeno: "2026-09-13 20:14:02" znaku: 33451 slov: 5298 kodovani: "utf-8" sha256: "5eaba7fe0825a11f46602d77850d65ea8192a1009f46329cad29bfd4be87a703" --- Part I Chapter 2 # Markup Date published: 2024/11/11 Last updated: 2026/09/06 Written by [Estela Franco](/en/2024/contributors#guaca) Reviewed by [Brian Kardell](/en/2024/contributors#bkardell) , [Jens Oliver Meiert](/en/2024/contributors#j9t) , and [Simon Pieters](/en/2024/contributors#zcorpan) Analyzed by [Estela Franco](/en/2024/contributors#guaca) ## Introduction The web as we know it is built on the foundation of HTML. Every website, every web application, and every online interaction starts with HTML at its core, making it one of the most essential web standards. It’s the language that structures content, defines relationships, and communicates with browsers, ensuring that what we create can be viewed, interacted with, and understood by users worldwide. This chapter is dedicated to understanding how HTML continues to shape the web in 2024, exploring trends in its use, the rise of custom elements, and how developers are leveraging new features to build more accessible, efficient, and future-proof websites. This year’s edition brings a broader perspective, as our dataset now includes not only home pages but also a wide variety of secondary pages. By analyzing pages beyond just the front doors of websites, we’re able to capture a richer, more accurate snapshot of how HTML is used across different types of content and contexts. From blog posts and product pages to login screens and article archives, this expanded scope gives us deeper insights into the real-world application of HTML. We encourage readers to dive deeper into the data, explore their own insights, and join the conversation about the future of the web’s foundational language. ## General Let’s start with some of the more general aspects of a markup document. In this section we’re covering the document types, the size of the documents, language and compression. ‘ ### Doctypes | Doctype | [Rendering Mode](https://hsivonen.fi/doctype/) | Desktop | Mobile | | --- | --- | --- | --- | | `` | standards mode | 91.7% | 92.8% | | `html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"` | almost standards mode | 3.4% | 2.7% | | No doctype | quirks mode | 2.1% | 2.2% | | `html public "-//w3c//dtd xhtml 1.0 strict//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-strict.dtd"` | standards mode | 0.8% | 0.7% | | `html public "-//w3c//dtd html 4.01 transitional//en" "http://www.w3.org/tr/html4/loose.dtd"` | almost standards mode | 0.6% | 0.4% | | `html public "-//w3c//dtd html 4.01 transitional//en"` | quirks mode | 0.3% | 0.3% | Figure 2.1. Doctype usage. 92.8% Figure 2.2. Mobile pages using the standard HTML doctype. 93% of all mobile pages use the standard HTML doctype. That is, ``. This is 3 percentage points higher than [the 2022 data](../2022/markup#doctypes). The surprising part is the next most popular: `XHTML 1.1 Transitional`—but slowly disappearing (2.7%, down from 3.9% in 2022). ### Document size A page’s document size is the amount of HTML bytes transferred over the network, including compression. Bar chart showing the median transfer size of HTML document. In 2022, the median was 31 kB on desktop and 29 on mobile. In 2023, 30 kB on desktop and 29 kB on mobile. And in 2024, 33 kB on desktop and 32 kB on mobile. Figure 2.3. Median transfer size of HTML document. After a slight decrease in 2023, the HTML transfer size increased this year compared to 2022 and 2023. Although the median looks like something reasonable, let’s take a closer look at the other percentiles. Bar chart showing the 10, 25, 50, 75, and 90th percentile of transfer size. The values for mobile are 6, 13, 32, 71, 147 kB respectively. The values for desktop are 6, 14, 33, 73, 148 kB respectively. Figure 2.4. Distribution of the transfer size of HTML document. The percentile distribution reveals that at the 10th percentile, HTML files are as small as 6 KB, while at the 90th percentile, they reach up to 147 KB. These extremes highlight a significant variation in how developers structure their pages. ### Compression In the context of analyzing HTML document files, compression continues to play a crucial role in improving load times and overall performance. Stacked bar chart, showing 36% of desktop and 37% of mobile HTML documents are being compressed with Brotli, 53% of desktop and 52% of mobile documents are being compressed with Gzip, and 11% of desktop and mobile HTML documents are not being compressed at all. Figure 2.5. HTML document content-encoding. One notable trend is the increasing popularity of the Brotli (`br`) compression format. In 2024, Brotli is used on 37% of mobile pages, a steady increase from 28% in 2023. While `gzip` remains the most widely used compression method (52% on mobile), its usage has slightly declined from previous year as `br` gains traction (58% in 2022). Despite these improvements, a small percentage of HTML files (10.5% on mobile) are still served without any compression, presenting missed opportunities for optimization. ### Document language 5,625 Figure 2.6. Unique lang attribute codes on mobile. In our analysis, we’ve encountered 5,625 unique instances of the `lang` attribute on the `html` element on mobile. The HTML `lang` attribute plays an important role in helping screen readers and search engines understand the language of a webpage’s content. However, interestingly, Google Search ignores the lang attribute when determining the language of a page because [they’ve identified that “it is almost always wrong”](https://www.youtube.com/watch?v=isW-Ke-AJJU&t=3354s). This may explain why `en` remains dominant in the dataset, with 44.2% of desktop and 40.5% of mobile pages using it as the primary language attribute, even though the actual language of the content might differ. Bar chart showing the language usage, for the top ten languages in our data set. 40% use English, 13% are not set, with Spanish, Japanese, German, French, Portuguese, Russian, Italian and Dutch having various minor percentages of usage, from 6% to 2%. Figure 2.7. Most popular HTML language codes, not including region. Additionally, 13% of pages have no `lang` attribute set at all, showing that many websites fail to provide this indicator. If we aggregate the percentages of non-English and non-“not set” `lang` values, we still capture around 46% of the total pages, reflecting the truly global nature of web content. However, as mentioned above, it’s important to remember that the high proportion of `en` values doesn’t always mean the content is in English, given the frequent misconfiguration of the `lang` attribute. Bar chart showing the language usage, including region, for the top ten languages in our data set. 22% use English, 15% American English, with Japanese, Spanish, Brazilian Portuguese, British English, German German, Russian and German having various minor percentages of usage, from 5% to 2%. Figure 2.8. Most popular HTML language codes, including region. In terms of non-English languages, `ja` (Japanese) and `es` (Spanish) stand out as some of the most popular choices, used on approximately 5-6% of pages. The most common regional variant, `en-us`, appears on 16.7% of desktop and 15% of mobile pages. Despite the issues with incorrect lang attribute values, the attribute still plays a vital role in improving accessibility. For users with screen readers, setting the `lang` attribute correctly remains an essential practice in modern web development. ### Comments HTML comments are snippets of text that developers include within their code to leave notes or explanations without affecting the visual display of the webpage. These comments are enclosed in `` tags and are not rendered by browsers, meaning users will never see them. While useful during the development process, HTML comments are not necessary in production code, as they can slightly increase the file size without any benefit to end users. 86% Figure 2.9. Mobile pages with at least one comment. According to our analysis, 86% of mobile pages still contain at least one comment. In addition to regular comments, there’s a specific type known as **conditional comments**. These were once used extensively to target specific versions of Internet Explorer (IE), allowing developers to provide custom styles or scripts that only older IE browsers would process. With modern browsers and the retirement of Internet Explorer, conditional comments have become obsolete. Despite this, **26%** of mobile pages still contain conditional comments, likely due to legacy code that was never cleaned up, or because some sites continue to support older versions of Internet Explorer for compatibility reasons. ## Elements In this section, we’ll explore HTML elements—what elements are commonly used, how often they appear, and which ones you’re likely to find on a typical page. We’ll also look into custom and outdated elements. And just to clarify: is “divitis” still around? Yes, it is. ### Element diversity For both desktop and mobile pages, the data shows that the 10th percentile has 22 distinct elements, while the 90th percentile reaches 44 elements on desktop and 43 on mobile. The median number of distinct elements for mobile pages has remained consistent at 32 this year, [the same as in 2022](../2022/markup#element-diversity), and only slightly higher than the [31 observed in 2021](../2021/markup#element-diversity). Bar chart showing the 10, 25, 50, 75, and 90th percentile of distinct elements per page. The values for mobile are 22, 27, 32, 38 and 43 respectively. The values for desktop are 22, 27, 33, 38 and 44 respectively. Figure 2.10. Distribution of the number of distinct types of elements per page. However, there are some differences when checking the distribution of elements per page. The data shows a slight decrease [compared to 2022](../2022/markup#element-diversity). For mobile, the median number of elements has dropped from 653 in 2022 to 594 in 2024. At the lower end, the 10th percentile for mobile shows a small drop from 192 to 180. The 90th percentile also shows a modest decrease, with mobile pages dropping from 1,832 to 1,716. This overall reduction suggests that pages are becoming slightly leaner in terms of the number of HTML elements used. Bar chart showing the 10, 25, 50, 75, and 90th percentile of total elements per page. The values for mobile are 180, 342, 594, 1,010 and 1,716 respectively. Figure 2.11. Distribution of the number of elements per page. ### Top elements The following elements are used most frequently: | 2021 | 2022 | 2023 | 2024 | | --- | --- | --- | --- | | `div` | `div` | `div` | `div` | | `a` | `a` | `a` | `a` | | `span` | `span` | `span` | `span` | | `li` | `li` | `li` | `li` | | `img` | `img` | `script` | `script` | | `script` | `script` | `img` | `img` | | `p` | `p` | `p` | `p` | | `link` | `link` | `link` | `link` | | `meta` | `i` | `meta` | `path` | | `i` | `meta` | `path` | `meta` | Figure 2.12. Most used elements. The list remains largely consistent with previous years, but some shifts have occurred. 29% Figure 2.13. Percentage of elements which are div elements. `
` remains by far the most dominant element. So “divitis” is still a thing, and it doesn’t look like it’s going to change in the next few years. Bar chart showing the frquency of top 15 HTML elements. `div` is the most used (28.7% on mobile), followed by `a` (12.6%), `span` (11.2%), `li` (7.7%) and `script` (3.9%). The rest of the top 15 elements are `img` , `p` , `link` , `path` , `meta` , `i` , `option` , `ul` , `br` , and `td` , with values ranging from 3.3% to 1.3%. Figure 2.14. Frequency of top HTML elements. Following `
`, the `` element remains a key player, consistently in second place. As the backbone of hyperlinking, it plays a critical role in navigation, anchoring user journeys across sites. One of the notable shifts in recent years has been the increased usage of `