An AI-generated showcase of HTML, CSS, JavaScript, SVG, and MathML for testing and comparing minification tools (used by Minifier Benchmarks).
Text Content Elements
The Art of Semantic HTML
Published on by Jane Developer
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Visit Example.com for more information.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
The power of the Web is in its universality. Access by everyone regardless of disability is an essential aspect.
— Tim Berners-Lee
Use Ctrl+S to save your work. The output will display: File saved successfully. Remember that E equals mc².
Key Concepts
Semantic HTML
Using HTML elements for their given purpose, conveying meaning to both the browser and the developer.
Accessibility
The practice of making websites usable by as many people as possible, including those with disabilities.
SEO
Search Engine Optimization — improving the visibility and ranking of web pages in organic search results.
function greetUser(name) {
if (!name) {
console.error("Name is required");
return;
}
const greeting = `Hello, ${name}! Welcome to our platform.`;
console.log(greeting);
return greeting;
}
// Example usage
greetUser("Developer");
The HTML specification defines CSS integration through the <style> element. Water is H2O and E=mc2 is Einstein's famous equation. Small text is often used for disclaimers and legal notices.
Contact: test@example.com
123 Web Development Lane
Code City, CC 12345
More Semantic Text
A minifier rewrites markup without changing its meaning, and the smallest useful change is often a single byte. The HTML Living Standard describes the goal as “transforming a document into a semantically equivalent one”.
Version history: 2.0 was replaced by 3.1, which ships 3,120 documents and was released on .
Measurements keep their units: 1920 × 1080 px, 20 %, ±0.5 °C.
Comments and Whitespace
Comments come in many shapes, and every one of them is something a minifier may drop, move, or break:
Regular text follows a conditional comment.
Comments in Sensitive Positions
Before a list item
After a list item
Comments between table rows
One
Two
// A comment inside <pre> is shown, not parsed
const ratio = 16 / 9;
/* … and a comment with a closing tag: </code> is text here. */
Whitespace That Must Survive
Spaces between inline elements are content: first linksecond link and an inline span next to text. A minifier that trims every run of whitespace renders this as first linksecond link.
Non-breaking spaces hold units and initials together: 10 px, 09:30 am, Mc Donald, and a no-break before a unit, such as 50 km.
A line break before this paragraph matters:
… and one after it.
Empty elements below render nothing but keep their tags:
Long tokens such as https://example.com/assets/very/long/path/minifier-benchmark-2024-06-01/report.json?section=results&rows=all&format=json need word breaking, not whitespace removal.
Preformatted Text
The newline after a <pre> start tag and the newline before its end tag are removed by the parser, which is why the indentation of the block below is meaningful:
first line starts with a tab
second line with two tabs
third line after a blank line
The same rule applies to <textarea>, whose leading newline is dropped, so the placeholder below is indented by one tab:
Whitespace in Attributes and Selectors
Class lists, lang attributes, and aria values all contain meaningful spaces:
Figure 1: An example of inline SVG with gradients, filters, and geometric shapes.
Audio and Video (Placeholder Elements)
The following are placeholder elements demonstrating the structure:
Embedded Object
Picture Element
Frames
A plain src frame with a name, lazy loading, and a referrer policy.The same frame with a srcdoc attribute: a whole document, including a doctype, a style element, and escaped markup, inside one attribute value.
Canvas with Fallback Content
Image Map
Rectangular, circular, and polygonal areas referencing fragments on this page.
Astral plane characters need a surrogate pair when written numerically, as in 😀 (U+1F600) and 💩 (U+1F4A9); the same characters written literally look like this: 😀 💩 🚀. The document declares its encoding in <meta charset="UTF-8">.
Fallback parentheses for browsers without ruby support: 漢字 and 日本語. The readings 漢字 use a preloaded web font.
Typography
Straight quotes "double" and 'single' beside curly “double” and ‘single’ quotes; an em dash—like this one—without surrounding spaces, an en dash – like this one – with them, a horizontal ellipsis…, a double vertical line ‖, and French spacing before punctuation: a space, a semicolon; a question? a colon: a guillemet «yes».
Attributes and URLs
Boolean Attributes
A boolean attribute is present or absent, and an empty value is still true: checked unchecked .
More boolean attributes in context: (multiple file input) and , plus open on the details elements, controls, muted, loop, and playsinline on media, novalidate on forms, itemscope on the product below, and inert on an inert container.
Quotes inside values: single-quoted with double quotes and escaped double quotes. Newlines and tabs inside a value are kept as written:
This element uses a style attribute that spans
two source lines and declares a custom property.
Trailing spaces in a value: visible only in the source, and a long value: data-report='{"rows":[1,2,3],"format":"json","filter":"all","sort":"desc","limit":100}'.
Global and Data Attributes
A Widget with the identifier SKU-4711, an external product page, and an aggregate rating of 4.5 from 128 reviews.
Arbitrary data-* attributes, aria-* attributes, and framework hooks such as is, slot, and part all survive minification unchanged: Tooltip hint
Width descriptors (400w, 800w) with a sizes attribute and per-category loading hints.Pixel density descriptors (1x, 2x) for the same image.
An image without intrinsic dimensions, loaded cross-origin with a referrer policy: .
Tabular Data
Browser Compatibility Matrix
Feature
Chrome
Firefox
Safari
Edge
CSS Grid
57+
52+
10.1+
16+
CSS Flexbox
29+
28+
9+
12+
ES6 Modules
61+
60+
10.1+
16+
Web Components
67+
63+
10.1+
79+
Last updated: January 2024
Complex Table with Row/Column Groups
Product
Price
Stock
Laptop Pro X1
$1,299
15
Wireless Mouse
$29
142
Mechanical Keyboard
$149
38
Row and Column Spans
Release schedule with row and column spans
Quarter
Status
Downloads
From
To
Version
Count
2024
Supported
3.0 – 3.4
2.1
480
2025
Supported
3.5
1,200
860
Download counts are fictional and updated monthly.
Header References and Empty Cells
Explicit header references and a deliberately empty cell
Name
Type
Size
index.html
Page
minifier-test.html
Page
30 kB
Table in a Cell
A table nested inside a table cell
Plain cell
Nested caption
Nested one
Nested two
Form Elements
Progress and Meter Elements
Download progress:
Disk usage: 70%
More Input Types
Autocomplete Tokens
Constraint Attributes
Constraints by control type
Attribute
Applies to
Notes
required
All controls except button and output
Blocks submission and drives the :invalid and :valid pseudo-classes
pattern
text, search, tel, url, email, password
Regular expression source without delimiters
minlength, maxlength
Text-like inputs and textarea
Counted in UTF-16 code units, not characters
min, max, step
number, range, date, time, month, week, datetime-local
Step may be any or a floating-point number
multiple
file, email, select
Comma-separated list for email
readonly versus disabled
Text-like inputs, textarea, select
Read-only fields are submitted, disabled fields are not
list, size
input with datalist, select, textarea
size sets the visible width, not the character limit
placeholder
Text-like inputs and textarea
Not a label; it disappears as soon as typing starts
Output and Live Values
Live output:
Inline SVG Examples
Icons
Data Visualization
Complex SVG with Animations
Symbols, Reuse, and Namespaces
The second <use> uses the legacy xlink:href attribute, which only works as long as the xmlns:xlink namespace declaration survives.
Paths, Markers, and Text
Patterns, Clipping, and Masks
Nested SVG and Foreign Content
Animation Timing
Gradients, Filters, and Units
Inline MathML
The quadratic formula is represented as:
Einstein's mass-energy equivalence:
The Pythagorean theorem:
Integral example:
Matrix representation:
Semantics and Annotations
Presentation MathML with a TeX annotation and a plain-text alternative:
Presentation attributes instead of CSS, and the available mathvariant values:
Stacks, Roots, and Enclosures
Delimiters, spacing, and invisible layout elements:
Stretchable and large operators:
Matrices, Cases, and Alignment
Multi-Index Notation
Legacy and Deprecated Markup
These elements are obsolete but still parse, and a minifier has to keep, convert, or drop each of them deliberately:
Centered text in a nested smaller font
Big text, struck through, teletype, and CSS
A unit that cannot break: 20 KB, and .
The raw text elements below keep their content verbatim, including </b>, &, and <b>:
not bold & not an entityTwo spaces of indentation
and one tab
Presentational Attributes
A table laid out with presentational attributes only
30 % wide
Right aligned, top aligned, 40 px high
Retired Plug-in Elements
Obsolete Attributes
Image alignment, border, hspace, vspace, longdesc, ismap, and lowsrc all still parse:
Frame-based layouts used <frameset>, <frame>, and <noframes>, scripts carried a language attribute, and the alink, link, text, and vlink attributes once lived on <body>.
CSS Feature Coverage
The stylesheet of this page exercises the features below, and the block at its end repeats most of them as unused rules.
Cascade Layers
Layered panel
Three @layer blocks set the border style, the background, and the heading background. The unlayered .demo-panel rule wins over all three.
Container Queries
Narrow
Below 34rem of container width, the cards stack their content vertically.
Wide
Wider containers switch the cards to a row layout, because the main grid already stretches them.
Relative Selectors
With a badge
New
Cards with a badge are outlined by :has(.badge), and the badge itself adds an arrow through ::after.
Without a badge
A card with two paragraphs in a row is styled by :has(> h4 + p + p).
This one keeps the muted color.
Checkbox Tabs
The panel visibility uses :checked with the general sibling combinator, and the labels are selected with an attribute selector.
The hidden radios stay in the tab order, so :focus-visible can draw a focus ring on the label list.
Generated Content
A drop cap is drawn with ::first-letter, which is a common reason for minifiers to lose whitespace inside text.
A quotation with decorative quotation marks from ::before and ::after.
List markers restyled with ::marker
Selection colors from ::selection on the panels above
Fluid Sizing and Aspect Ratios
Clamped type
A paragraph with a maximum measure and text-wrap: balance, which falls back silently where the property is unsupported.
Color Functions
A panel with color-scheme: light dark and light-dark() colors, so it follows the operating system.
Registered Custom Properties
The conic gradient above animates --demo-angle, registered through @property, which makes a custom property animatable and interpolatable.
Figures, Progress, and Status
Minification is a trade-off between bytes and debuggability, and the tools that hide it best are not always the tools that break it least.
— An anonymous reviewer
A dashed status box for live regions, notifications, and toasts.
Accessibility and ARIA
Accessibility attributes are as fragile as everything else on this page: a minifier that drops an unknown attribute silently removes behaviour.
Landmarks and Names
Labelled and Described Groups
Region with a label
An error message is linked with aria-describedby and referenced again with aria-errormessage:
Please enter a name with at least two characters.
Tabs, Toggles, and Live Regions
The first panel, referenced by aria-labelledby.
The second panel, hidden with the hidden attribute.
Content revealed by a toggle button, with aria-pressed and aria-expanded kept in sync by script.
This status region is polite, atomic, and empty of announcements until script fills it.
This alert is announced as soon as it appears.
This log region is intentionally silent.
Images, Icons, and Hidden Text
Decorative icons are hidden from assistive technology with aria-hidden="true" and focusable="false", while meaningful graphics get a role and a label: .
An image with an empty alt attribute is decorative and needs no label.
Screen reader only text.(hidden from screen readers)
HTML minification is the process of removing unnecessary characters from HTML code without changing its functionality. This includes removing whitespace, comments, and sometimes shortening class names or removing unused CSS.
Why is minification important?
Minification reduces file sizes, which leads to faster page loads and reduced bandwidth usage. This improves user experience and can positively impact search engine rankings.
Best practices for minification
Always keep unminified versions for development
Use source maps for debugging
Test thoroughly after minification
Consider compression (gzip, brotli) in addition to minification
Dialog Element
Template Element
Template Title
This content is from a template element.
Popover
Popover panel
A popover opens through popovertarget and closes through light dismiss, without any script. The attribute also works without a value.
Exclusive Details
Do optional end tags change rendering?
No. The parser closes them at the same points, which is what the optional end tags section shows.
Does minification reorder attributes?
Attribute order carries no meaning, except for a duplicated attribute, where the parser keeps the first one.
Table Row Template
Rows cloned from a template
Tool
Ratio
Baseline
100 %
Inline Script Hazards
The script below holds constructs that minifiers regularly break: angle brackets in comments and comparisons, an escaped closing tag, a regular expression, a template literal, optional chaining, and a thrown error.
The script writes its results here.
Optional End Tags and Legacy Parsing
HTML5 lets a number of end tags be left out. The parser closes them at fixed points, so a minifier that adds or removes them changes nothing—but one that adds them in the wrong place does.
Paragraphs and Line Items
The first paragraph ends where the second one starts, without any closing tags
The second paragraph ends with the list below
A list item that ends at the next item
A second item
A third item
Ordered lists keep their numbering in reverse:
c
b
a
Table Structure
Every cell in this table is closed implicitly
Element
End tag
tr
optional when a new tr follows
td
optional at the end of a row
tbody
optional at the end of a table
Definitions and Options
A term without a closing tag
A description closed by the next dt
A second term
The last description before the closing dl tag
Options behave the same way:
Case and Whitespace in Tags
Uppercase element names are lowercased by the parser
An obsolete presentational attribute, kept for the parser test
Unquoted and Spaced Attribute Values
Values may be unquoted, as in this link, or spaced around the equals sign, as in that link. An empty value is allowed too, which is why the field below has an attribute but no text:
Void Elements
Void elements are never closed. An <img> with an empty alt attribute renders as a tiny broken image box , a <br> ends the line where it stands, a <wbr> offers a break opportunity inside transforming, and a hidden input renders nothing at all . A horizontal rule is void as well:
…so the paragraph below it needs no closing tag either.