HTML Compatibility: Apps, Versions and Common Limits
Understand why a valid HTML file can behave differently across applications and devices.
Parser Error Recovery vs. Strict Parsing
Every HTML consumer builds a document tree from tokens. The HTML Living Standard mandates a specific error-recovery algorithm for malformed markup, but applications implement it with different degrees of fidelity.
Desktop browsers (Chrome, Firefox, Safari, Edge) follow the spec’s tree-construction rules closely. They silently close unclosed elements, reorder misplaced tags, and insert implied <tbody> or <head> elements. A file missing </body> and </html> will still produce a complete DOM tree with those nodes present.
Email clients and rich-text editors often use strict or stripped-down parsers. Outlook’s rendering engine (Word-based) rejects unknown elements outright and strips <style> blocks, <script>, and <form> tags before building the tree. Gmail removes all external stylesheets and inlines only a subset of CSS properties. The same HTML newsletter that renders with columns in a browser collapses to a single stack in Outlook.
E-book readers (Kindle, Apple Books, Kobo) parse a deliberately restricted HTML subset. They ignore <iframe>, <object>, <embed>, and most interactive elements. Kindle’s KF8 format supports a limited HTML5 vocabulary; any element outside that set is treated as an opaque inline container, preserving its text content but discarding its semantic role.
The spec states: “The tree construction stage takes the sequence of tokens and builds a DOM tree. This stage is defined in terms of a stack of open elements.” Applications that skip or simplify this stack produce structurally different trees from identical tokens—the root cause of cross-application DOM divergence.
CSS and Layout Engine Variance
HTML defines structure. Visual output depends on the user agent’s styling engine, and engines differ even when they share a parser.
- Box model discrepancies: Safari’s WebKit and Firefox’s Gecko compute
width: 100%differently inside a flex container when padding is present. In WebKit, the padding adds to the computed width; in Gecko,box-sizing: border-boxis required to match. The HTML and CSS are identical; the layout shifts. - Font fallback chains:
font-family: "Helvetica Neue", Arial, sans-serifresolves to different physical fonts on macOS (Helvetica Neue), Windows (Arial), and Linux (a sans-serif like DejaVu Sans). Glyph widths, x-heights, and line metrics change, altering line breaks and page length. - Unsupported properties:
position: stickyis supported in all modern browsers but ignored in most HTML-to-PDF converters (wkhtmltopdf, Prince, WeasyPrint). A page depending on sticky headers will display them in Chrome but lose them entirely in the PDF output. - Print vs. screen media: Browsers apply
@media printrules during print or PDF export. Background colors and images are suppressed by default. A page with white text on a dark background becomes invisible in print unless-webkit-print-color-adjust: exactorprint-color-adjust: exactis set.
Feature Support Gaps by Application Category
Desktop Browsers (Chrome 120+, Firefox 120+, Safari 17+)
Full HTML5, SVG, MathML, JavaScript, and modern CSS are supported. The primary limit is the same-origin security model: scripts loaded from a file:// path cannot fetch other local files without explicit user permission. An HTML file that loads a JSON dataset via fetch() will fail silently when opened directly from disk.
Mobile Browsers (iOS Safari, Android Chrome)
These use the same engines as their desktop counterparts, but viewport and input handling differ. :hover pseudo-classes do not apply; touch events replace mouse events. background-attachment: fixed is ignored on iOS Safari because it causes performance issues during scroll. Layouts using fixed pixel widths overflow the viewport or require horizontal scrolling.
Offline Document Viewers (Microsoft Word, LibreOffice, Apple Pages)
These import HTML through converters that target a subset of HTML4 and CSS2. Flexbox, Grid, @media queries, and @font-face are ignored. <button>, <input>, and <select> elements render as static text or images—forms cannot be submitted. Tables survive the import; div-based layouts collapse.
Email Clients (Outlook, Gmail, Apple Mail)
Only inline CSS is reliable. <style> blocks are stripped by Gmail and partially stripped by Outlook. background-image is ignored in Outlook. max-width, min-height, and position are unsupported. Layout must use <table> elements; div-based multi-column designs collapse into a single vertical stack.
E-book Readers and PDF Converters (Calibre, Pandoc, Prince, wkhtmltopdf)
JavaScript is never executed. SVG support is partial—Kindle ignores it; Apple Books renders it. Multi-column CSS layouts flatten to single-column text. Calibre’s WebKit-based engine supports more CSS than Kindle’s proprietary renderer, so an EPUB that looks correct in Calibre’s viewer may reflow incorrectly on a Kindle device.
Observable Validation Checks for html compatibility apps versions limitations
A file that passes the W3C validator can still fail in specific applications. Run these checks to surface compatibility gaps:
- Disable JavaScript in a desktop browser and reload the page. Any content that disappears or becomes non-functional will be absent in email clients, e-book readers, and PDF converters.
- Print-preview the page in Chrome or Firefox. Elements that vanish, shift, or lose styling reveal dependencies on screen-only CSS or unsupported print properties.
- Open the file in a text-based browser (Lynx or
curlpiped toless). This exposes the raw content order and reveals whether critical information is hidden inside<img>elements withoutalttext or inside script-generated DOM nodes. - Inline all CSS and remove
<style>blocks, then test in at least one email client. If the layout breaks, it will break in Gmail and Outlook. - Resize the viewport to 320px width. Layouts that overflow or require horizontal scrolling will fail on mobile devices.
Unsupported Features That Fail Silently
Some features are not rejected with an error—they are silently ignored, misleading authors into assuming cross-application compatibility.
contenteditable: Browsers allow inline editing. PDF converters and e-book readers render the content as static text with no editing affordance.autofocus: Works in desktop browsers but is often suppressed on mobile because it triggers the on-screen keyboard unexpectedly. The spec notes that user agents may ignoreautofocusbased on user preferences.target="_blank": Opens a new tab in browsers. Document viewers and e-book readers ignore the attribute; the link navigates in the current context or fails entirely if the viewer cannot open external resources.downloadattribute on<a>: Browsers prompt a file save dialog. E-book readers and PDF converters treat the link as a standard navigation target, often producing a broken link or error.<details>and<summary>: Browsers provide native expand/collapse behavior. Offline viewers and email clients render the content fully expanded with no toggle mechanism, so hidden supplementary content becomes permanently visible.
Version-Specific Browser Behaviour
The HTML Living Standard is continuously updated. A feature stable in current browsers may have been experimental or absent in versions released 12 months prior.
<dialog>element: Supported in Chrome 112+, Firefox 114+, Safari 15.4+. Older versions ignore the element or render it as a generic block-level container with no modal behavior and noshowModal()method.loading="lazy"on<iframe>: Supported in Chrome 121+, Firefox 121+, Safari 16.4+. Earlier versions ignore the attribute and load the iframe immediately, negating the performance benefit.- CSS
@containerqueries: Supported in Chrome 105+ and Safari 16+. Firefox added support in version 110. Pages using container queries as the sole responsive mechanism break entirely in unsupported browsers. inertattribute: Supported in Chrome 102+, Firefox 112+, Safari 15.5+. Older versions ignore it; interactive elements meant to be disabled remain focusable and clickable.
Consult the HTML Living Standard’s obsolete features appendix before using any deprecated element or attribute. Attributes like align on <div> or bgcolor on <body> are documented there as obsolete—they may work in older parsers but are ignored in current browsers.
Hard Limits by Application Type
| Application Type | Parser Strictness | CSS Support | JS Execution | Maximum File Size (practical) |
|---|---|---|---|---|
| Desktop browser | Forgiving (spec-compliant error recovery) | Full CSS3+ | Yes | 10–50 MB before tab crash |
| Mobile browser | Forgiving | Full (viewport-adjusted) | Yes | 5–20 MB before memory pressure |
| Word processor | Strict (HTML4 subset) | Basic CSS2 | No | 2–5 MB before import failure |
| Email client | Very strict (inline-only CSS) | Inline properties only | No | 100–200 KB (Gmail clips at 102 KB) |
| E-book reader | Strict (KF8/ePub subset) | Subset of CSS2 | No | 5–10 MB per chapter |
| PDF converter | Moderate | Partial CSS3 (engine-dependent) | No | Unlimited, but 50+ MB PDFs are impractical |
When authoring for multiple targets, treat the desktop browser as the primary renderer, then test and adjust for each secondary target individually. The specification guarantees DOM tree correctness under compliant parsing; it guarantees nothing about visual output, interactive behavior, or rendering performance across different user agents.