Repository navigation
Expand file tree
/
Copy pathhtml.html
More file actions
1050 lines (933 loc) · 67 KB
/
Copy pathhtml.html
File metadata and controls
1050 lines (933 loc) · 67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>HTML Cheatsheet</title>
<style>
:root {
--bg: #f7f8fa;
--panel: #ffffff;
--text: #1c1e21;
--muted: #5b6270;
--border: #e2e5ea;
--accent: #4f8ef7;
--code-bg: #f0f2f5;
}
* { box-sizing: border-box; }
body {
margin: 0;
font-family: -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
background: var(--bg);
color: var(--text);
line-height: 1.5;
}
header.page-header { padding: 1.6rem 1.5rem .8rem; text-align: center; }
header.page-header h1 { margin: 0 0 .3rem; font-size: 1.8rem; }
header.page-header p { color: var(--muted); margin: 0 auto; max-width: 640px; }
.sheet-links { margin-top: .6rem; font-size: .85rem; }
.sheet-links a { color: var(--accent); text-decoration: none; margin: 0 .4rem; font-weight: 600; }
.sheet-links a:hover { text-decoration: underline; }
.sheet-links a.current { color: var(--text); text-decoration: underline; }
.live-note {
max-width: 700px; margin: .8rem auto 0; padding: .6rem .9rem;
background: #eaf1ff; border: 1px solid #b9d1fb; border-radius: 8px;
font-size: .8rem; color: #1d4a8f; text-align: center;
}
.search-bar {
position: sticky; top: 0; z-index: 20;
background: var(--bg);
padding: .8rem 1.5rem;
border-bottom: 1px solid var(--border);
}
.search-bar input {
width: 100%; max-width: 700px; display: block; margin: 0 auto;
padding: .65rem .9rem; font-size: 1rem;
border: 2px solid var(--border); border-radius: 10px;
outline: none; background: var(--panel); color: var(--text);
}
.search-bar input:focus { border-color: var(--accent); }
.search-meta { text-align: center; font-size: .78rem; color: var(--muted); margin-top: .35rem; }
nav.toc {
max-width: 1100px; margin: 1rem auto; padding: .8rem 1.2rem;
background: var(--panel); border: 1px solid var(--border); border-radius: 10px;
}
nav.toc ul { display: flex; flex-wrap: wrap; gap: .5rem; list-style: none; padding: 0; margin: 0; }
nav.toc a {
display: inline-block; padding: .3rem .7rem; border-radius: 999px;
background: var(--code-bg); color: var(--accent); text-decoration: none; font-size: .82rem;
}
nav.toc a:hover { background: var(--accent); color: #fff; }
main { max-width: 1100px; margin: 0 auto 3rem; padding: 0 1.2rem; }
section.category {
background: var(--panel); border: 1px solid var(--border); border-radius: 10px;
margin: 1.4rem 0; padding: 1.1rem 1.2rem;
}
section.category h2 { margin: 0 0 .3rem; font-size: 1.2rem; }
section.category .cat-intro {
margin: 0 0 1rem; padding-bottom: .8rem; color: var(--muted); font-size: .85rem;
border-bottom: 2px solid var(--accent);
}
section.category.hidden { display: none; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: .9rem; }
.cheat-card {
border: 1px solid var(--border); border-radius: 10px; padding: .8rem .9rem .9rem; background: #fdfdfe;
display: flex; flex-direction: column;
}
.cheat-card.hidden { display: none; }
.cheat-card h3 {
margin: 0 0 .35rem; font-size: 1rem;
font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
color: var(--accent);
}
.cheat-card p.desc { margin: 0 0 .55rem; font-size: .82rem; color: var(--text); opacity: .85; }
.micro-label {
font-size: .65rem; text-transform: uppercase; letter-spacing: .06em;
color: var(--muted); font-weight: 700; margin: 0 0 .25rem;
}
.cheat-card pre {
margin: 0 0 .6rem; background: var(--code-bg); padding: .5rem .6rem; border-radius: 6px;
font-size: .74rem; overflow-x: auto; white-space: pre-wrap; overflow-wrap: anywhere;
}
.cheat-card .preview { font-size: .82rem; margin-top: auto; }
.preview-box {
border: 1px dashed var(--border); border-radius: 6px; padding: .5rem .6rem;
background: #fafbfc; font-size: .8rem;
}
code { font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace; }
table.legacy { width: 100%; border-collapse: collapse; }
table.legacy th, table.legacy td {
text-align: left; padding: .5rem; border-bottom: 1px solid var(--border); font-size: .82rem;
}
table.legacy code { color: #c0392b; }
#no-results { text-align: center; color: var(--muted); padding: 2rem; display: none; }
footer.page-footer { text-align: center; color: var(--muted); font-size: .8rem; padding: 2rem 0; }
</style>
</head>
<body>
<header class="page-header">
<h1>HTML Cheatsheet</h1>
<p>Every HTML5 element, grouped by category. Each card renders the tag for real, right below the code, so you see exactly what the browser does with it.</p>
<div class="sheet-links">
<a href="html.html" class="current">HTML</a>·
<a href="css.html">CSS</a>·
<a href="javascript.html">JavaScript</a>·
<a href="angular.html">Angular</a>
</div>
<div class="live-note">🧩 Boxes labeled <strong>Result</strong> are the actual element, rendered live by your browser from the code shown above — not a screenshot or description.</div>
</header>
<div class="search-bar">
<input type="text" id="search" placeholder="Search tags... (e.g. button, table, form)" autocomplete="off">
<div class="search-meta" id="search-meta"></div>
</div>
<nav class="toc" aria-label="Table of contents">
<ul>
<li><a href="#meta">Document & Metadata</a></li>
<li><a href="#scripting-head">Scripting</a></li>
<li><a href="#sectioning">Sectioning</a></li>
<li><a href="#text">Text Content</a></li>
<li><a href="#inline">Inline Semantics</a></li>
<li><a href="#edits">Edits</a></li>
<li><a href="#media">Media</a></li>
<li><a href="#embed">Embedded Content</a></li>
<li><a href="#table">Tables</a></li>
<li><a href="#forms">Forms</a></li>
<li><a href="#interactive">Interactive</a></li>
<li><a href="#legacy">Legacy Tags</a></li>
</ul>
</nav>
<main>
<!-- ===================== DOCUMENT & METADATA ===================== -->
<section class="category" id="meta">
<h2>Document & Metadata</h2>
<p class="cat-intro">The skeleton every HTML page starts from — nothing here is visible on its own, but it's required scaffolding.</p>
<div class="grid">
<div class="cheat-card" data-key="doctype declaration html5 version">
<h3><!DOCTYPE></h3>
<p class="desc">Declares the document as HTML5, telling the browser to use standards mode instead of quirks mode. Must be the very first line of the file.</p>
<div class="micro-label">Code</div>
<pre><!DOCTYPE html></pre>
<div class="micro-label">Result</div>
<div class="preview"><div class="preview-box">No visible output — but omitting it can silently change how the whole page renders.</div></div>
</div>
<div class="cheat-card" data-key="html root element language">
<h3><html></h3>
<p class="desc">The root element wrapping the entire page. The <code>lang</code> attribute helps screen readers and translators identify the content language.</p>
<div class="micro-label">Code</div>
<pre><html lang="en">...</html></pre>
<div class="micro-label">Result</div>
<div class="preview"><div class="preview-box">No visible output — it's the container for <head> and <body>.</div></div>
</div>
<div class="cheat-card" data-key="head metadata container">
<h3><head></h3>
<p class="desc">Holds metadata about the document — title, links, scripts, meta tags — none of which is rendered directly on the page.</p>
<div class="micro-label">Code</div>
<pre><head><title>...</title></head></pre>
<div class="micro-label">Result</div>
<div class="preview"><div class="preview-box">No visible output on the page itself.</div></div>
</div>
<div class="cheat-card" data-key="title tab name">
<h3><title></h3>
<p class="desc">Sets the page title shown in the browser tab, bookmarks, and search engine results. Every page should have exactly one.</p>
<div class="micro-label">Code</div>
<pre><title>My Page</title></pre>
<div class="micro-label">Result</div>
<div class="preview"><div class="preview-box">This exact page's tab reads "HTML Cheatsheet" because of this tag.</div></div>
</div>
<div class="cheat-card" data-key="base relative url">
<h3><base></h3>
<p class="desc">Sets the base URL that all relative links and resources on the page resolve against. At most one per document.</p>
<div class="micro-label">Code</div>
<pre><base href="https://example.com/"></pre>
<div class="micro-label">Result</div>
<div class="preview"><div class="preview-box">No visible output — affects link resolution invisibly.</div></div>
</div>
<div class="cheat-card" data-key="link stylesheet icon external resource">
<h3><link></h3>
<p class="desc">Links external resources into the page, most commonly stylesheets and favicons. Self-closing, placed in the <code><head></code>.</p>
<div class="micro-label">Code</div>
<pre><link rel="stylesheet" href="style.css"></pre>
<div class="micro-label">Result</div>
<div class="preview"><div class="preview-box">No visible output — but this page's own styling comes from a <style> block using the same idea.</div></div>
</div>
<div class="cheat-card" data-key="meta charset viewport description">
<h3><meta></h3>
<p class="desc">Carries metadata such as character encoding, viewport settings, or page description — often invisible but critical for correct rendering and SEO.</p>
<div class="micro-label">Code</div>
<pre><meta charset="UTF-8"></pre>
<div class="micro-label">Result</div>
<div class="preview"><div class="preview-box">No visible output — this page uses it for UTF-8 and mobile viewport scaling.</div></div>
</div>
<div class="cheat-card" data-key="style css inline">
<h3><style></h3>
<p class="desc">Defines CSS rules directly inside the document, scoped to the whole page. An alternative to linking an external stylesheet.</p>
<div class="micro-label">Code</div>
<pre><style>p { color: red; }</style></pre>
<div class="micro-label">Result</div>
<div class="preview"><div class="preview-box">Every visual style on this entire cheatsheet comes from one of these.</div></div>
</div>
<div class="cheat-card" data-key="body visible content">
<h3><body></h3>
<p class="desc">Contains everything the user actually sees or interacts with. A page has exactly one <code><body></code>.</p>
<div class="micro-label">Code</div>
<pre><body>...</body></pre>
<div class="micro-label">Result</div>
<div class="preview"><div class="preview-box">This entire visible page is the <body>.</div></div>
</div>
</div>
</section>
<!-- ===================== SCRIPTING ===================== -->
<section class="category" id="scripting-head">
<h2>Scripting & Templates</h2>
<p class="cat-intro">Elements that bring JavaScript and dynamic/drawn content into the page.</p>
<div class="grid">
<div class="cheat-card" data-key="script javascript">
<h3><script></h3>
<p class="desc">Embeds or references JavaScript. Placing it at the end of <code><body></code> or using <code>defer</code> avoids blocking page rendering.</p>
<div class="micro-label">Code</div>
<pre><script>console.log("hi")</script></pre>
<div class="micro-label">Result</div>
<div class="preview"><div class="preview-box">Shown as text here, not executed — see the JavaScript cheatsheet for live-running code.</div></div>
</div>
<div class="cheat-card" data-key="noscript fallback">
<h3><noscript></h3>
<p class="desc">Content shown only when JavaScript is disabled or unsupported — a fallback message or alternate markup.</p>
<div class="micro-label">Code</div>
<pre><noscript>JS is off</noscript></pre>
<div class="micro-label">Result</div>
<div class="preview"><div class="preview-box">Invisible here, since your browser almost certainly has JS enabled.</div></div>
</div>
<div class="cheat-card" data-key="template clone shadow dom">
<h3><template></h3>
<p class="desc">Holds inert markup that isn't rendered or executed until JavaScript explicitly clones it — used to stamp out repeated UI pieces.</p>
<div class="micro-label">Code</div>
<pre><template id="t"><li>Item</li></template></pre>
<div class="micro-label">Result</div>
<div class="preview">
<div class="preview-box">Not rendered until cloned by JS — present in this page's DOM but invisible.</div>
<template id="demo-template"><li>Item</li></template>
</div>
</div>
<div class="cheat-card" data-key="slot web components placeholder">
<h3><slot></h3>
<p class="desc">A placeholder inside a web component's Shadow DOM where light-DOM content gets projected — only meaningful inside custom elements.</p>
<div class="micro-label">Code</div>
<pre><slot name="title"></slot></pre>
<div class="micro-label">Result</div>
<div class="preview"><div class="preview-box">Only active inside a custom element's shadow root.</div></div>
</div>
<div class="cheat-card" data-key="canvas drawing graphics">
<h3><canvas></h3>
<p class="desc">A blank drawing surface controlled entirely by JavaScript (2D or WebGL) — used for games, charts, and image manipulation.</p>
<div class="micro-label">Code</div>
<pre><canvas width="120" height="60"></canvas></pre>
<div class="micro-label">Result</div>
<div class="preview"><canvas width="120" height="60" style="border:1px solid var(--border)"></canvas></div>
</div>
</div>
</section>
<!-- ===================== SECTIONING ===================== -->
<section class="category" id="sectioning">
<h2>Sectioning</h2>
<p class="cat-intro">Landmark elements that describe the structural regions of a page — good for both readability and screen-reader navigation.</p>
<div class="grid">
<div class="cheat-card" data-key="header page top">
<h3><header></h3>
<p class="desc">Introductory content for a page or a section — typically a logo, title, or navigation. A page can have several, one per section.</p>
<div class="micro-label">Code</div>
<pre><header>Page header</header></pre>
<div class="micro-label">Result</div>
<div class="preview"><div class="preview-box"><header>Page header</header></div></div>
</div>
<div class="cheat-card" data-key="nav navigation links">
<h3><nav></h3>
<p class="desc">Marks a block of primary navigation links, letting assistive tech and browsers identify it as a landmark for skipping straight to.</p>
<div class="micro-label">Code</div>
<pre><nav><a href="#">Home</a></nav></pre>
<div class="micro-label">Result</div>
<div class="preview"><div class="preview-box"><nav aria-label="Example navigation"><a href="#inline">Home</a></nav></div></div>
</div>
<div class="cheat-card" data-key="main content once per page">
<h3><main></h3>
<p class="desc">The primary content of the page, excluding repeated elements like headers, footers, and sidebars. Should appear only once per page.</p>
<div class="micro-label">Code</div>
<pre><main>Main content</main></pre>
<div class="micro-label">Result</div>
<div class="preview"><div class="preview-box">Main content</div></div>
</div>
<div class="cheat-card" data-key="article standalone blog post">
<h3><article></h3>
<p class="desc">A self-contained piece of content that would make sense distributed on its own — a blog post, forum entry, or news story.</p>
<div class="micro-label">Code</div>
<pre><article>Article text</article></pre>
<div class="micro-label">Result</div>
<div class="preview"><div class="preview-box">Article text</div></div>
</div>
<div class="cheat-card" data-key="section thematic grouping">
<h3><section></h3>
<p class="desc">A thematic grouping of content, usually with its own heading. Less specific than <code><article></code> — use it when no more specific element fits.</p>
<div class="micro-label">Code</div>
<pre><section>Section</section></pre>
<div class="micro-label">Result</div>
<div class="preview"><div class="preview-box">Section</div></div>
</div>
<div class="cheat-card" data-key="aside sidebar tangential">
<h3><aside></h3>
<p class="desc">Content tangentially related to the surrounding content — a sidebar, pull quote, or ad — that could be removed without losing the main point.</p>
<div class="micro-label">Code</div>
<pre><aside>Tip: ...</aside></pre>
<div class="micro-label">Result</div>
<div class="preview"><div class="preview-box"><aside>Tip: ...</aside></div></div>
</div>
<div class="cheat-card" data-key="footer bottom copyright">
<h3><footer></h3>
<p class="desc">Footer content for a page or section — copyright, contact info, or related links. Like <code><header></code>, can appear multiple times.</p>
<div class="micro-label">Code</div>
<pre><footer>© 2026</footer></pre>
<div class="micro-label">Result</div>
<div class="preview"><div class="preview-box"><footer>© 2026</footer></div></div>
</div>
<div class="cheat-card" data-key="h1 h2 h3 h4 h5 h6 heading title">
<h3><h1>–<h6></h3>
<p class="desc">Headings from level 1 (most important, ideally one per page) to level 6 (least). Skipping levels for pure visual styling hurts accessibility.</p>
<div class="micro-label">Code</div>
<pre><h1>Title</h1> ... <h6>Title</h6></pre>
<div class="micro-label">Result</div>
<div class="preview"><div class="preview-box"><h3 style="margin:0">h3 heading</h3></div></div>
</div>
<div class="cheat-card" data-key="hgroup heading subtitle group">
<h3><hgroup></h3>
<p class="desc">Groups a heading together with one or more subtitle/tagline paragraphs, so they're understood as a single unit.</p>
<div class="micro-label">Code</div>
<pre><hgroup><h1>Title</h1><p>Subtitle</p></hgroup></pre>
<div class="micro-label">Result</div>
<div class="preview"><div class="preview-box"><hgroup><h4 style="margin:0">Title</h4><p style="margin:0">Subtitle</p></hgroup></div></div>
</div>
<div class="cheat-card" data-key="address contact info author">
<h3><address></h3>
<p class="desc">Contact information for the author or owner of the page or article — not for arbitrary postal addresses.</p>
<div class="micro-label">Code</div>
<pre><address>contact@example.com</address></pre>
<div class="micro-label">Result</div>
<div class="preview"><div class="preview-box"><address>contact@example.com</address></div></div>
</div>
</div>
</section>
<!-- ===================== TEXT CONTENT ===================== -->
<section class="category" id="text">
<h2>Text Content</h2>
<p class="cat-intro">Block-level elements for structuring paragraphs, lists, and other chunks of text.</p>
<div class="grid">
<div class="cheat-card" data-key="div generic block container">
<h3><div></h3>
<p class="desc">A generic block-level container with no inherent meaning — used purely for grouping and styling when no semantic element fits.</p>
<div class="micro-label">Code</div>
<pre><div>Content</div></pre>
<div class="micro-label">Result</div>
<div class="preview"><div class="preview-box">Content</div></div>
</div>
<div class="cheat-card" data-key="p paragraph text block">
<h3><p></h3>
<p class="desc">A paragraph of text. Browsers automatically add margin above and below it to separate paragraphs visually.</p>
<div class="micro-label">Code</div>
<pre><p>This is a paragraph.</p></pre>
<div class="micro-label">Result</div>
<div class="preview"><div class="preview-box"><p style="margin:0">This is a paragraph.</p></div></div>
</div>
<div class="cheat-card" data-key="hr horizontal rule divider">
<h3><hr></h3>
<p class="desc">A thematic break between content — rendered as a horizontal line by default, but semantically means "topic change", not just decoration.</p>
<div class="micro-label">Code</div>
<pre><hr></pre>
<div class="micro-label">Result</div>
<div class="preview"><div class="preview-box"><hr></div></div>
</div>
<div class="cheat-card" data-key="pre preformatted whitespace">
<h3><pre></h3>
<p class="desc">Preformatted text that preserves whitespace and line breaks exactly as written, and renders in a monospace font.</p>
<div class="micro-label">Code</div>
<pre><pre>Line 1
Line 2</pre></pre>
<div class="micro-label">Result</div>
<div class="preview"><div class="preview-box"><pre style="margin:0">Line 1
Line 2</pre></div></div>
</div>
<div class="cheat-card" data-key="blockquote quote citation">
<h3><blockquote></h3>
<p class="desc">A longer, block-level quotation from another source, typically indented by the browser's default stylesheet. Pair with <code><cite></code> for attribution.</p>
<div class="micro-label">Code</div>
<pre><blockquote>A quote.</blockquote></pre>
<div class="micro-label">Result</div>
<div class="preview"><div class="preview-box"><blockquote style="margin:0 0 0 1em">A quote.</blockquote></div></div>
</div>
<div class="cheat-card" data-key="ol ordered numbered list">
<h3><ol></h3>
<p class="desc">An ordered (numbered) list, where the sequence of items matters — steps in a recipe, ranked results, and so on.</p>
<div class="micro-label">Code</div>
<pre><ol><li>One</li><li>Two</li></ol></pre>
<div class="micro-label">Result</div>
<div class="preview"><div class="preview-box"><ol style="margin:0;padding-left:1.2em"><li>One</li><li>Two</li></ol></div></div>
</div>
<div class="cheat-card" data-key="ul unordered bullet list">
<h3><ul></h3>
<p class="desc">An unordered (bulleted) list, for items where order doesn't carry meaning — the most common list type.</p>
<div class="micro-label">Code</div>
<pre><ul><li>Apple</li><li>Pear</li></ul></pre>
<div class="micro-label">Result</div>
<div class="preview"><div class="preview-box"><ul style="margin:0;padding-left:1.2em"><li>Apple</li><li>Pear</li></ul></div></div>
</div>
<div class="cheat-card" data-key="li list item entry">
<h3><li></h3>
<p class="desc">A single list item — only valid as a direct child of <code><ol></code>, <code><ul></code>, or <code><menu></code>.</p>
<div class="micro-label">Code</div>
<pre><li>Item</li></pre>
<div class="micro-label">Result</div>
<div class="preview"><div class="preview-box">See the lists above — every bullet/number there is one of these.</div></div>
</div>
<div class="cheat-card" data-key="menu command toolbar list">
<h3><menu></h3>
<p class="desc">A list intended for commands or toolbar-style actions. Renders identically to <code><ul></code> in most browsers today.</p>
<div class="micro-label">Code</div>
<pre><menu><li>Copy</li></menu></pre>
<div class="micro-label">Result</div>
<div class="preview"><div class="preview-box"><menu style="margin:0;padding-left:1.2em"><li>Copy</li></menu></div></div>
</div>
<div class="cheat-card" data-key="dl description definition list">
<h3><dl></h3>
<p class="desc">A description list of term/definition pairs — good for glossaries, metadata, or FAQ-style content.</p>
<div class="micro-label">Code</div>
<pre><dl><dt>HTML</dt><dd>Markup language</dd></dl></pre>
<div class="micro-label">Result</div>
<div class="preview"><div class="preview-box"><dl style="margin:0"><dt><b>HTML</b></dt><dd style="margin:0">Markup language</dd></dl></div></div>
</div>
<div class="cheat-card" data-key="dt term description">
<h3><dt></h3>
<p class="desc">The term being defined inside a <code><dl></code>, always followed by one or more matching <code><dd></code> elements.</p>
<div class="micro-label">Code</div>
<pre><dt>CSS</dt></pre>
<div class="micro-label">Result</div>
<div class="preview"><div class="preview-box">See <dl> above.</div></div>
</div>
<div class="cheat-card" data-key="dd definition description">
<h3><dd></h3>
<p class="desc">The description or definition that answers a preceding <code><dt></code> term.</p>
<div class="micro-label">Code</div>
<pre><dd>Styling language</dd></pre>
<div class="micro-label">Result</div>
<div class="preview"><div class="preview-box">See <dl> above.</div></div>
</div>
<div class="cheat-card" data-key="figure image caption media grouping">
<h3><figure></h3>
<p class="desc">Groups a self-contained piece of media — image, diagram, code listing — with an optional caption, as a single referenceable unit.</p>
<div class="micro-label">Code</div>
<pre><figure><img src="..."><figcaption>Text</figcaption></figure></pre>
<div class="micro-label">Result</div>
<div class="preview">
<div class="preview-box">
<figure style="margin:0">
<img src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='50'%3E%3Crect width='80' height='50' fill='%234f8ef7'/%3E%3C/svg%3E" alt="Placeholder" width="80" height="50">
<figcaption>Figure caption</figcaption>
</figure>
</div>
</div>
</div>
<div class="cheat-card" data-key="figcaption caption for figure">
<h3><figcaption></h3>
<p class="desc">The caption for a <code><figure></code>, placed as its first or last child.</p>
<div class="micro-label">Code</div>
<pre><figcaption>Caption</figcaption></pre>
<div class="micro-label">Result</div>
<div class="preview"><div class="preview-box">See <figure> above.</div></div>
</div>
</div>
</section>
<!-- ===================== INLINE ===================== -->
<section class="category" id="inline">
<h2>Inline Text Semantics</h2>
<p class="cat-intro">Elements that style or add meaning to a run of text without breaking the line.</p>
<div class="grid">
<div class="cheat-card" data-key="a anchor link href"><h3><a></h3><p class="desc">Creates a hyperlink to another page, resource, or location on the same page via <code>href</code>.</p><div class="micro-label">Code</div><pre><a href="#">Link</a></pre><div class="micro-label">Result</div><div class="preview"><a href="#inline">Link</a></div></div>
<div class="cheat-card" data-key="em emphasis italic"><h3><em></h3><p class="desc">Marks text with stress emphasis — changes the meaning of a sentence, unlike purely visual italics.</p><div class="micro-label">Code</div><pre><em>important</em></pre><div class="micro-label">Result</div><div class="preview"><em>important</em></div></div>
<div class="cheat-card" data-key="strong bold important"><h3><strong></h3><p class="desc">Marks text as strongly important, serious, or urgent — semantically stronger than plain <code><b></code>.</p><div class="micro-label">Code</div><pre><strong>urgent</strong></pre><div class="micro-label">Result</div><div class="preview"><strong>urgent</strong></div></div>
<div class="cheat-card" data-key="small fine print legal"><h3><small></h3><p class="desc">Represents side comments and small print, such as legal disclaimers or fine print — not just visually smaller text.</p><div class="micro-label">Code</div><pre><small>Note</small></pre><div class="micro-label">Result</div><div class="preview"><small>Note</small></div></div>
<div class="cheat-card" data-key="s strikethrough no longer accurate"><h3><s></h3><p class="desc">Marks text that is no longer accurate or relevant, such as a superseded price — rendered with a strikethrough.</p><div class="micro-label">Code</div><pre><s>$19.99</s></pre><div class="micro-label">Result</div><div class="preview"><s>$19.99</s></div></div>
<div class="cheat-card" data-key="cite title of a work"><h3><cite></h3><p class="desc">Marks the title of a creative work being referenced — a book, film, song, or painting, not the author's name.</p><div class="micro-label">Code</div><pre><cite>Faust</cite></pre><div class="micro-label">Result</div><div class="preview"><cite>Faust</cite></div></div>
<div class="cheat-card" data-key="q inline quote quotation"><h3><q></h3><p class="desc">A short inline quotation — the browser automatically adds quotation marks around it based on language.</p><div class="micro-label">Code</div><pre><q>Quote</q></pre><div class="micro-label">Result</div><div class="preview"><q>Quote</q></div></div>
<div class="cheat-card" data-key="dfn definition term"><h3><dfn></h3><p class="desc">Marks the defining instance of a term — the spot where it's first explained, not every later mention.</p><div class="micro-label">Code</div><pre><dfn>HTML</dfn> is a language.</pre><div class="micro-label">Result</div><div class="preview"><dfn>HTML</dfn> is a language.</div></div>
<div class="cheat-card" data-key="abbr abbreviation tooltip title"><h3><abbr></h3><p class="desc">Marks an abbreviation or acronym; the <code>title</code> attribute supplies the full expansion, shown as a tooltip on hover.</p><div class="micro-label">Code</div><pre><abbr title="HyperText Markup Language">HTML</abbr></pre><div class="micro-label">Result — hover it</div><div class="preview"><abbr title="HyperText Markup Language">HTML</abbr></div></div>
<div class="cheat-card" data-key="ruby annotation pronunciation"><h3><ruby></h3><p class="desc">A container for ruby annotations — small pronunciation or translation notes placed above East Asian characters.</p><div class="micro-label">Code</div><pre><ruby>漢<rt>kan</rt></ruby></pre><div class="micro-label">Result</div><div class="preview"><ruby>漢<rt>kan</rt></ruby></div></div>
<div class="cheat-card" data-key="rt ruby text annotation"><h3><rt></h3><p class="desc">The annotation/pronunciation text shown above the base text inside a <code><ruby></code> element.</p><div class="micro-label">Code</div><pre><rt>kan</rt></pre><div class="micro-label">Result</div><div class="preview">See <ruby> above.</div></div>
<div class="cheat-card" data-key="rp ruby parentheses fallback"><h3><rp></h3><p class="desc">Provides fallback parentheses around ruby text for browsers that don't support the <code><ruby></code> layout.</p><div class="micro-label">Code</div><pre><rp>(</rp><rt>kan</rt><rp>)</rp></pre><div class="micro-label">Result</div><div class="preview">See <ruby> above.</div></div>
<div class="cheat-card" data-key="data machine readable value"><h3><data></h3><p class="desc">Links human-readable text to a machine-readable value via the <code>value</code> attribute, for scripts to consume.</p><div class="micro-label">Code</div><pre><data value="123">Product #123</data></pre><div class="micro-label">Result</div><div class="preview"><data value="123">Product #123</data></div></div>
<div class="cheat-card" data-key="time date datetime"><h3><time></h3><p class="desc">Marks a date or time in a machine-readable format via <code>datetime</code>, while displaying human-friendly text.</p><div class="micro-label">Code</div><pre><time datetime="2026-08-10">Aug 10, 2026</time></pre><div class="micro-label">Result</div><div class="preview"><time datetime="2026-08-10">Aug 10, 2026</time></div></div>
<div class="cheat-card" data-key="code monospace snippet"><h3><code></h3><p class="desc">Marks a short fragment of computer code, rendered in the browser's default monospace font.</p><div class="micro-label">Code</div><pre><code>let x = 1;</code></pre><div class="micro-label">Result</div><div class="preview"><code>let x = 1;</code></div></div>
<div class="cheat-card" data-key="var variable math"><h3><var></h3><p class="desc">Marks a variable name in a mathematical or programming context, typically rendered in italics.</p><div class="micro-label">Code</div><pre><var>x</var> = 5</pre><div class="micro-label">Result</div><div class="preview"><var>x</var> = 5</div></div>
<div class="cheat-card" data-key="samp sample program output"><h3><samp></h3><p class="desc">Marks sample output from a computer program, typically rendered in monospace.</p><div class="micro-label">Code</div><pre><samp>File not found</samp></pre><div class="micro-label">Result</div><div class="preview"><samp>File not found</samp></div></div>
<div class="cheat-card" data-key="kbd keyboard input keypress"><h3><kbd></h3><p class="desc">Marks user keyboard input, such as a shortcut — commonly styled to look like a physical key.</p><div class="micro-label">Code</div><pre><kbd>Ctrl + C</kbd></pre><div class="micro-label">Result</div><div class="preview"><kbd>Ctrl + C</kbd></div></div>
<div class="cheat-card" data-key="sub subscript"><h3><sub></h3><p class="desc">Renders text as subscript — lowered and smaller, as in chemical formulas.</p><div class="micro-label">Code</div><pre>H<sub>2</sub>O</pre><div class="micro-label">Result</div><div class="preview">H<sub>2</sub>O</div></div>
<div class="cheat-card" data-key="sup superscript"><h3><sup></h3><p class="desc">Renders text as superscript — raised and smaller, as in exponents or footnote markers.</p><div class="micro-label">Code</div><pre>x<sup>2</sup></pre><div class="micro-label">Result</div><div class="preview">x<sup>2</sup></div></div>
<div class="cheat-card" data-key="i italic alternate voice"><h3><i></h3><p class="desc">Renders text in italics for an "alternate voice" — a technical term, foreign phrase, or ship name — with no extra emphasis implied.</p><div class="micro-label">Code</div><pre><i>Carpe diem</i></pre><div class="micro-label">Result</div><div class="preview"><i>Carpe diem</i></div></div>
<div class="cheat-card" data-key="b bold keyword"><h3><b></h3><p class="desc">Renders text in bold to draw attention, such as keywords in a summary, without implying extra importance.</p><div class="micro-label">Code</div><pre><b>Keyword</b></pre><div class="micro-label">Result</div><div class="preview"><b>Keyword</b></div></div>
<div class="cheat-card" data-key="u underline"><h3><u></h3><p class="desc">Renders an unarticulated, non-textual annotation — commonly a spelling-error underline or proper name marking.</p><div class="micro-label">Code</div><pre><u>Caution</u></pre><div class="micro-label">Result</div><div class="preview"><u>Caution</u></div></div>
<div class="cheat-card" data-key="mark highlight"><h3><mark></h3><p class="desc">Highlights text for reference purposes, e.g. matching a search term — rendered with a yellow background by default.</p><div class="micro-label">Code</div><pre><mark>important</mark></pre><div class="micro-label">Result</div><div class="preview"><mark>important</mark></div></div>
<div class="cheat-card" data-key="bdi isolate text direction"><h3><bdi></h3><p class="desc">Isolates a span of text whose directionality is unknown, so it doesn't scramble the layout of surrounding text — useful for user-generated names.</p><div class="micro-label">Code</div><pre><bdi>اسم</bdi> won</pre><div class="micro-label">Result</div><div class="preview"><bdi>اسم</bdi> won</div></div>
<div class="cheat-card" data-key="bdo bidirectional override direction"><h3><bdo></h3><p class="desc">Forces text to render in a specific direction (<code>ltr</code> or <code>rtl</code>), overriding the browser's automatic detection.</p><div class="micro-label">Code</div><pre><bdo dir="rtl">Text</bdo></pre><div class="micro-label">Result</div><div class="preview"><bdo dir="rtl">Text</bdo></div></div>
<div class="cheat-card" data-key="span generic inline container"><h3><span></h3><p class="desc">A generic inline container with no inherent meaning — the inline equivalent of <code><div></code>, used for styling hooks.</p><div class="micro-label">Code</div><pre><span style="color:red">red</span></pre><div class="micro-label">Result</div><div class="preview"><span style="color:red">red</span></div></div>
<div class="cheat-card" data-key="br line break"><h3><br></h3><p class="desc">Forces a line break within text — for addresses or poetry, not for adding visual spacing between paragraphs.</p><div class="micro-label">Code</div><pre>Line 1<br>Line 2</pre><div class="micro-label">Result</div><div class="preview">Line 1<br>Line 2</div></div>
<div class="cheat-card" data-key="wbr word break opportunity"><h3><wbr></h3><p class="desc">Suggests an optional line-break point inside a long word — the browser only breaks there if it actually needs to.</p><div class="micro-label">Code</div><pre>Super<wbr>califragilistic</pre><div class="micro-label">Result</div><div class="preview">Super<wbr>califragilistic</div></div>
</div>
</section>
<!-- ===================== EDITS ===================== -->
<section class="category" id="edits">
<h2>Edits</h2>
<p class="cat-intro">Elements that annotate revision history directly in the markup.</p>
<div class="grid">
<div class="cheat-card" data-key="ins inserted underline added">
<h3><ins></h3>
<p class="desc">Marks text that has been newly inserted into a document, typically rendered underlined. Useful for change-tracking views.</p>
<div class="micro-label">Code</div>
<pre><ins>newly added</ins></pre>
<div class="micro-label">Result</div>
<div class="preview"><ins>newly added</ins></div>
</div>
<div class="cheat-card" data-key="del deleted strikethrough removed">
<h3><del></h3>
<p class="desc">Marks text that has been removed from a document, typically rendered with a strikethrough — often paired with <code><ins></code>.</p>
<div class="micro-label">Code</div>
<pre><del>old price</del></pre>
<div class="micro-label">Result</div>
<div class="preview"><del>old price</del></div>
</div>
</div>
</section>
<!-- ===================== MEDIA ===================== -->
<section class="category" id="media">
<h2>Images & Multimedia</h2>
<p class="cat-intro">Elements for embedding pictures, audio, and video directly into the page.</p>
<div class="grid">
<div class="cheat-card" data-key="img image picture src alt">
<h3><img></h3>
<p class="desc">Embeds an image. The <code>alt</code> attribute is required for accessibility — it's read aloud by screen readers and shown if the image fails to load.</p>
<div class="micro-label">Code</div>
<pre><img src="pic.png" alt="Description"></pre>
<div class="micro-label">Result</div>
<div class="preview"><img src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='50'%3E%3Crect width='80' height='50' fill='%234f8ef7'/%3E%3C/svg%3E" alt="Placeholder" width="80" height="50"></div>
</div>
<div class="cheat-card" data-key="picture responsive image sources">
<h3><picture></h3>
<p class="desc">A container that offers multiple image sources so the browser can pick the best one for the screen size or format support.</p>
<div class="micro-label">Code</div>
<pre><picture><source srcset="..."><img src="..."></picture></pre>
<div class="micro-label">Result</div>
<div class="preview">
<picture>
<source srcset="data:image/svg+xml;base64,PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHdpZHRoPSc4MCcgaGVpZ2h0PSc1MCc+PHJlY3Qgd2lkdGg9JzgwJyBoZWlnaHQ9JzUwJyBmaWxsPScjMzRhODUzJy8+PC9zdmc+ 1x" media="(min-width: 1px)">
<img src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='50'%3E%3Crect width='80' height='50' fill='%234f8ef7'/%3E%3C/svg%3E" alt="Placeholder" width="80" height="50">
</picture>
</div>
</div>
<div class="cheat-card" data-key="source alternative media file">
<h3><source></h3>
<p class="desc">Specifies an alternative media file inside <code><picture></code>, <code><audio></code>, or <code><video></code> — the browser picks the first one it supports.</p>
<div class="micro-label">Code</div>
<pre><source src="video.webm" type="video/webm"></pre>
<div class="micro-label">Result</div>
<div class="preview"><div class="preview-box">Not rendered on its own — see <picture> above for it in action.</div></div>
</div>
<div class="cheat-card" data-key="audio sound player controls">
<h3><audio></h3>
<p class="desc">Embeds an audio file with a built-in player UI when <code>controls</code> is set. No file is loaded here, so the player appears disabled.</p>
<div class="micro-label">Code</div>
<pre><audio controls src="sound.mp3"></audio></pre>
<div class="micro-label">Result</div>
<div class="preview"><audio controls style="max-width:180px"></audio></div>
</div>
<div class="cheat-card" data-key="video player controls poster">
<h3><video></h3>
<p class="desc">Embeds a video file with playback controls. <code>poster</code> sets a preview image shown before playback starts.</p>
<div class="micro-label">Code</div>
<pre><video controls poster="pic.png" src="movie.mp4"></video></pre>
<div class="micro-label">Result</div>
<div class="preview"><video controls style="max-width:180px" poster="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='50'%3E%3Crect width='80' height='50' fill='%23e67e22'/%3E%3C/svg%3E"></video></div>
</div>
<div class="cheat-card" data-key="track subtitles captions">
<h3><track></h3>
<p class="desc">Adds a subtitle, caption, or description track to <code><audio></code>/<code><video></code>, loaded from a separate WebVTT file.</p>
<div class="micro-label">Code</div>
<pre><track kind="subtitles" src="en.vtt" srclang="en"></pre>
<div class="micro-label">Result</div>
<div class="preview"><div class="preview-box">Not rendered on its own — appears as a subtitle toggle in a real player.</div></div>
</div>
<div class="cheat-card" data-key="map image map clickable area">
<h3><map></h3>
<p class="desc">Defines a clickable image map, pairing named regions of an image with links via child <code><area></code> elements.</p>
<div class="micro-label">Code</div>
<pre><map name="m"><area shape="rect" coords="0,0,40,50" href="#"></map></pre>
<div class="micro-label">Result — try clicking the left half</div>
<div class="preview">
<img src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='50'%3E%3Crect width='80' height='50' fill='%239b59b6'/%3E%3C/svg%3E" width="80" height="50" usemap="#demo-map" alt="Map">
<map name="demo-map"><area shape="rect" coords="0,0,40,50" href="#embed" alt="left half"></map>
</div>
</div>
<div class="cheat-card" data-key="area clickable region map">
<h3><area></h3>
<p class="desc">Defines one clickable, linked region within a <code><map></code>, using a shape (rect/circle/poly) and coordinates.</p>
<div class="micro-label">Code</div>
<pre><area shape="circle" coords="60,25,20" href="#"></pre>
<div class="micro-label">Result</div>
<div class="preview">See <map> above.</div>
</div>
</div>
</section>
<!-- ===================== EMBED ===================== -->
<section class="category" id="embed">
<h2>Embedded Content</h2>
<p class="cat-intro">Elements for pulling in other documents, plugins, or vector/math content.</p>
<div class="grid">
<div class="cheat-card" data-key="iframe embed another document">
<h3><iframe></h3>
<p class="desc">Embeds another full HTML document inside the current page, in its own independent browsing context — used for maps, ads, and widgets.</p>
<div class="micro-label">Code</div>
<pre><iframe src="page.html"></iframe></pre>
<div class="micro-label">Result</div>
<div class="preview"><iframe title="Example iframe" srcdoc="<p style='font-family:sans-serif;margin:4px'>Hello from the iframe</p>" style="width:150px;height:60px;border:1px solid var(--border)"></iframe></div>
</div>
<div class="cheat-card" data-key="embed plugin external content pdf">
<h3><embed></h3>
<p class="desc">Embeds external or plugin-handled content, such as a PDF or SVG — an older, simpler alternative to <code><object></code>.</p>
<div class="micro-label">Code</div>
<pre><embed src="file.pdf" type="application/pdf"></pre>
<div class="micro-label">Result</div>
<div class="preview"><embed src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='50'%3E%3Crect width='80' height='50' fill='%232ecc71'/%3E%3C/svg%3E" type="image/svg+xml" width="80" height="50"></div>
</div>
<div class="cheat-card" data-key="object embed resource fallback">
<h3><object></h3>
<p class="desc">Embeds an external resource — image, PDF, or another HTML document — and can hold fallback content shown if it fails to load.</p>
<div class="micro-label">Code</div>
<pre><object data="file.svg" type="image/svg+xml"></object></pre>
<div class="micro-label">Result</div>
<div class="preview"><object data="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='50'%3E%3Crect width='80' height='50' fill='%23e74c3c'/%3E%3C/svg%3E" type="image/svg+xml" width="80" height="50">Placeholder image</object></div>
</div>
<div class="cheat-card" data-key="param object parameter">
<h3><param></h3>
<p class="desc">Passes a name/value parameter to a parent <code><object></code> element — a legacy mechanism mostly tied to plugin content.</p>
<div class="micro-label">Code</div>
<pre><param name="autoplay" value="false"></pre>
<div class="micro-label">Result</div>
<div class="preview"><div class="preview-box">No visible output on its own.</div></div>
</div>
<div class="cheat-card" data-key="svg vector graphics">
<h3><svg></h3>
<p class="desc">A container for scalable vector graphics defined directly in markup — shapes stay crisp at any zoom level, unlike raster images.</p>
<div class="micro-label">Code</div>
<pre><svg width="60" height="60"><circle cx="30" cy="30" r="25" fill="teal"/></svg></pre>
<div class="micro-label">Result</div>
<div class="preview"><svg width="60" height="60"><circle cx="30" cy="30" r="25" fill="teal"></circle></svg></div>
</div>
<div class="cheat-card" data-key="math mathml formula">
<h3><math></h3>
<p class="desc">A container for mathematical notation written in MathML, rendered natively by the browser without images or libraries.</p>
<div class="micro-label">Code</div>
<pre><math><mi>x</mi><mo>+</mo><mn>1</mn></math></pre>
<div class="micro-label">Result</div>
<div class="preview"><math><mi>x</mi><mo>+</mo><mn>1</mn></math></div>
</div>
</div>
</section>
<!-- ===================== TABLES ===================== -->
<section class="category" id="table">
<h2>Tables</h2>
<p class="cat-intro">Elements for tabular data — rows and columns of related values, not for page layout.</p>
<div class="grid">
<div class="cheat-card" data-key="table grid rows columns">
<h3><table></h3>
<p class="desc">The root element of a data table, wrapping optional caption, column groups, header, body, and footer sections.</p>
<div class="micro-label">Code</div>
<pre><table>...</table></pre>
<div class="micro-label">Result</div>
<div class="preview">
<table style="border-collapse:collapse;font-size:.78rem">
<caption>Example table</caption>
<colgroup><col style="background:#eef"><col></colgroup>
<thead><tr><th style="border:1px solid #ccc;padding:2px">A</th><th style="border:1px solid #ccc;padding:2px">B</th></tr></thead>
<tbody><tr><td style="border:1px solid #ccc;padding:2px">1</td><td style="border:1px solid #ccc;padding:2px">2</td></tr></tbody>
<tfoot><tr><td style="border:1px solid #ccc;padding:2px">Σ</td><td style="border:1px solid #ccc;padding:2px">3</td></tr></tfoot>
</table>
</div>
</div>
<div class="cheat-card" data-key="caption table title"><h3><caption></h3><p class="desc">The title or caption of a table, always the first child of <code><table></code> and displayed above it by default.</p><div class="micro-label">Code</div><pre><caption>Example table</caption></pre><div class="micro-label">Result</div><div class="preview">See <table> above.</div></div>
<div class="cheat-card" data-key="colgroup group columns"><h3><colgroup></h3><p class="desc">Groups one or more columns so they can be styled together, e.g. a shared background — placed right after <code><caption></code>.</p><div class="micro-label">Code</div><pre><colgroup><col><col></colgroup></pre><div class="micro-label">Result</div><div class="preview">See <table> above.</div></div>
<div class="cheat-card" data-key="col column style"><h3><col></h3><p class="desc">Defines styling for a single column inside a <code><colgroup></code>, without needing to touch every cell in that column.</p><div class="micro-label">Code</div><pre><col style="background:#eef"></pre><div class="micro-label">Result</div><div class="preview">See column A in <table> above.</div></div>
<div class="cheat-card" data-key="thead table header rows"><h3><thead></h3><p class="desc">Groups the header row(s) of a table, semantically separating column titles from the data.</p><div class="micro-label">Code</div><pre><thead><tr><th>A</th></tr></thead></pre><div class="micro-label">Result</div><div class="preview">See <table> above.</div></div>
<div class="cheat-card" data-key="tbody table body rows data"><h3><tbody></h3><p class="desc">Groups the main data rows of a table, distinct from the header and footer sections.</p><div class="micro-label">Code</div><pre><tbody><tr><td>1</td></tr></tbody></pre><div class="micro-label">Result</div><div class="preview">See <table> above.</div></div>
<div class="cheat-card" data-key="tfoot table footer sum"><h3><tfoot></h3><p class="desc">Groups the footer row(s) of a table — often totals or summary rows — and can appear before <code><tbody></code> in the source.</p><div class="micro-label">Code</div><pre><tfoot><tr><td>Σ</td></tr></tfoot></pre><div class="micro-label">Result</div><div class="preview">See <table> above.</div></div>
<div class="cheat-card" data-key="tr table row"><h3><tr></h3><p class="desc">A single table row, containing a sequence of <code><td></code> or <code><th></code> cells.</p><div class="micro-label">Code</div><pre><tr><td>Cell</td></tr></pre><div class="micro-label">Result</div><div class="preview">See <table> above.</div></div>
<div class="cheat-card" data-key="td table data cell"><h3><td></h3><p class="desc">A standard data cell. Supports <code>colspan</code>/<code>rowspan</code> to merge across multiple columns or rows.</p><div class="micro-label">Code</div><pre><td>Value</td></pre><div class="micro-label">Result</div><div class="preview">See <table> above.</div></div>
<div class="cheat-card" data-key="th table header cell"><h3><th></h3><p class="desc">A header cell, bold and centered by default, and announced differently by screen readers than a plain <code><td></code>.</p><div class="micro-label">Code</div><pre><th>Column title</th></pre><div class="micro-label">Result</div><div class="preview">See <table> above.</div></div>
</div>
</section>
<!-- ===================== FORMS ===================== -->
<section class="category" id="forms">
<h2>Forms</h2>
<p class="cat-intro">Elements for collecting and submitting user input.</p>
<div class="grid">
<div class="cheat-card" data-key="form action submit container">
<h3><form></h3>
<p class="desc">Wraps a set of controls into a single submittable unit, sending their values to a server via <code>action</code> and <code>method</code>.</p>
<div class="micro-label">Code</div>
<pre><form action="/submit">...</form></pre>
<div class="micro-label">Result</div>
<div class="preview"><div class="preview-box">A container — see the individual controls below for what it holds.</div></div>
</div>
<div class="cheat-card" data-key="label form field caption">
<h3><label></h3>
<p class="desc">A caption for a form control. Linking it via <code>for</code>/<code>id</code> lets clicking the label focus the matching input — good for accessibility and touch targets.</p>
<div class="micro-label">Code</div>
<pre><label for="n">Name</label></pre>
<div class="micro-label">Result</div>
<div class="preview"><label for="demo-input">Name</label></div>
</div>
<div class="cheat-card" data-key="input text checkbox radio number date field">
<h3><input></h3>
<p class="desc">A versatile input field whose <code>type</code> attribute drastically changes its behavior — text, number, checkbox, date, color, and more.</p>
<div class="micro-label">Code</div>
<pre><input type="text" placeholder="Name"></pre>
<div class="micro-label">Result — try typing in it</div>
<div class="preview"><input id="demo-input" type="text" placeholder="Name" style="width:100px"></div>
</div>
<div class="cheat-card" data-key="button click submit reset">
<h3><button></h3>
<p class="desc">A clickable button. The <code>type</code> attribute (<code>submit</code>, <code>reset</code>, or <code>button</code>) controls what it does inside a form.</p>
<div class="micro-label">Code</div>
<pre><button>Submit</button></pre>
<div class="micro-label">Result</div>
<div class="preview"><button type="button">Submit</button></div>
</div>
<div class="cheat-card" data-key="select dropdown option">
<h3><select></h3>
<p class="desc">A dropdown selection list built from child <code><option></code> elements — good when there are more than a handful of choices.</p>
<div class="micro-label">Code</div>
<pre><select><option>Red</option></select></pre>
<div class="micro-label">Result — try opening it</div>
<div class="preview"><select><option>Red</option><option>Green</option></select></div>
</div>
<div class="cheat-card" data-key="datalist autocomplete suggestions">
<h3><datalist></h3>
<p class="desc">Provides a list of autocomplete suggestions for a text <code><input></code>, without restricting the input to only those values.</p>
<div class="micro-label">Code</div>
<pre><input list="colors"><datalist id="colors"><option value="Red"></datalist></pre>
<div class="micro-label">Result — start typing "r"</div>
<div class="preview"><input list="demo-colors" placeholder="Color" style="width:100px"><datalist id="demo-colors"><option value="Red"></option><option value="Blue"></option></datalist></div>
</div>
<div class="cheat-card" data-key="optgroup group select options">
<h3><optgroup></h3>
<p class="desc">Groups related <code><option></code> entries inside a <code><select></code> under a shared, non-selectable label.</p>
<div class="micro-label">Code</div>
<pre><optgroup label="Colors"><option>Red</option></optgroup></pre>
<div class="micro-label">Result</div>
<div class="preview"><select><optgroup label="Colors"><option>Red</option></optgroup></select></div>
</div>
<div class="cheat-card" data-key="option select choice item">
<h3><option></h3>
<p class="desc">A single choice inside a <code><select></code> or <code><datalist></code>. The <code>value</code> attribute is what's actually submitted.</p>
<div class="micro-label">Code</div>
<pre><option value="r">Red</option></pre>
<div class="micro-label">Result</div>
<div class="preview">See <select> above.</div>
</div>
<div class="cheat-card" data-key="textarea multiline text input">
<h3><textarea></h3>
<p class="desc">A resizable, multi-line plain-text input field — unlike <code><input></code>, its content goes between the opening and closing tags.</p>
<div class="micro-label">Code</div>
<pre><textarea rows="2"></textarea></pre>
<div class="micro-label">Result — try typing in it</div>
<div class="preview"><textarea rows="2" style="width:120px"></textarea></div>
</div>
<div class="cheat-card" data-key="output result calculation">
<h3><output></h3>
<p class="desc">Displays the result of a calculation or user action, usually updated live by JavaScript — e.g. the sum of two range sliders.</p>
<div class="micro-label">Code</div>
<pre><output>42</output></pre>
<div class="micro-label">Result</div>
<div class="preview"><output>42</output></div>
</div>
<div class="cheat-card" data-key="progress bar loading task">
<h3><progress></h3>
<p class="desc">A progress bar for a task with a known completion percentage, driven by the <code>value</code> and <code>max</code> attributes.</p>
<div class="micro-label">Code</div>
<pre><progress value="70" max="100"></progress></pre>
<div class="micro-label">Result</div>
<div class="preview"><progress value="70" max="100"></progress></div>
</div>
<div class="cheat-card" data-key="meter gauge scalar measurement">
<h3><meter></h3>
<p class="desc">A scalar measurement within a known range — disk usage, a rating, or a poll result — visually distinct from <code><progress></code>'s "task completion" meaning.</p>
<div class="micro-label">Code</div>
<pre><meter value="40" min="0" max="100"></meter></pre>
<div class="micro-label">Result</div>
<div class="preview"><meter value="40" min="0" max="100"></meter></div>
</div>
<div class="cheat-card" data-key="fieldset group form controls border">
<h3><fieldset></h3>
<p class="desc">Visually and semantically groups related form controls inside a border, typically labeled with a <code><legend></code>.</p>
<div class="micro-label">Code</div>
<pre><fieldset><legend>Address</legend>...</fieldset></pre>
<div class="micro-label">Result</div>
<div class="preview"><fieldset style="padding:.3rem"><legend>Address</legend><input style="width:80px" placeholder="City"></fieldset></div>
</div>
<div class="cheat-card" data-key="legend fieldset title">
<h3><legend></h3>
<p class="desc">The caption/title of a <code><fieldset></code>, always its first child.</p>
<div class="micro-label">Code</div>
<pre><legend>Address</legend></pre>
<div class="micro-label">Result</div>
<div class="preview">See <fieldset> above.</div>
</div>
</div>
</section>
<!-- ===================== INTERACTIVE ===================== -->
<section class="category" id="interactive">
<h2>Interactive Elements</h2>
<p class="cat-intro">Widgets with built-in interactivity that used to require JavaScript.</p>
<div class="grid">
<div class="cheat-card" data-key="details collapsible expandable disclosure">
<h3><details></h3>
<p class="desc">A collapsible content area, expandable/collapsible natively with no JavaScript — the <code>open</code> attribute controls its initial state.</p>
<div class="micro-label">Code</div>
<pre><details><summary>More</summary>Content</details></pre>
<div class="micro-label">Result — click to expand</div>
<div class="preview"><details><summary>More</summary>Hidden content</details></div>
</div>
<div class="cheat-card" data-key="summary details heading toggle">
<h3><summary></h3>
<p class="desc">The always-visible heading of a <code><details></code> element — clicking it toggles the rest of the content open or closed.</p>
<div class="micro-label">Code</div>
<pre><summary>Show more</summary></pre>
<div class="micro-label">Result</div>
<div class="preview">See <details> above.</div>
</div>
<div class="cheat-card" data-key="dialog modal popup">
<h3><dialog></h3>
<p class="desc">A native dialog window/modal. JavaScript's <code>showModal()</code> opens it with a backdrop and focus-trapping; the <code>open</code> attribute here just shows it inline.</p>
<div class="micro-label">Code</div>
<pre><dialog open>Hello!</dialog></pre>
<div class="micro-label">Result</div>
<div class="preview"><dialog open style="position:static;border:1px solid var(--border)">Hello!</dialog></div>
</div>
</div>
</section>
<!-- ===================== LEGACY ===================== -->
<section class="category" id="legacy">
<h2>Legacy / Obsolete Tags</h2>
<p class="cat-intro">These tags come from older HTML versions, are <strong>deprecated</strong> or <strong>obsolete</strong>, and should no longer be used. Listed for completeness only, no live preview.</p>
<table class="legacy">
<thead><tr><th>Tag</th><th>Replacement / Note</th></tr></thead>
<tbody>
<tr><td><code><acronym></code></td><td>replaced by <code><abbr></code></td></tr>
<tr><td><code><applet></code></td><td>Java applets, replaced by <code><object></code>/<code><canvas></code></td></tr>
<tr><td><code><basefont></code></td><td>replaced by CSS (<code>font</code>)</td></tr>
<tr><td><code><bgsound></code></td><td>replaced by <code><audio></code></td></tr>
<tr><td><code><big></code></td><td>replaced by CSS (<code>font-size</code>)</td></tr>
<tr><td><code><blink></code></td><td>never standardized, removed</td></tr>
<tr><td><code><center></code></td><td>replaced by CSS (<code>text-align</code>)</td></tr>
<tr><td><code><dir></code></td><td>replaced by <code><ul></code></td></tr>
<tr><td><code><font></code></td><td>replaced by CSS</td></tr>
<tr><td><code><frame></code> / <code><frameset></code> / <code><noframes></code></td><td>replaced by <code><iframe></code></td></tr>
<tr><td><code><isindex></code></td><td>replaced by <code><input></code></td></tr>
<tr><td><code><keygen></code></td><td>removed, no replacement</td></tr>
<tr><td><code><marquee></code></td><td>replaced by CSS animations</td></tr>
<tr><td><code><menuitem></code></td><td>experimental, removed</td></tr>
<tr><td><code><nobr></code></td><td>replaced by CSS (<code>white-space: nowrap</code>)</td></tr>
<tr><td><code><noembed></code></td><td>obsolete, no replacement needed</td></tr>
<tr><td><code><plaintext></code></td><td>replaced by <code><pre></code></td></tr>
<tr><td><code><rb></code> / <code><rtc></code></td><td>part of ruby syntax, rarely supported</td></tr>
<tr><td><code><spacer></code></td><td>replaced by CSS</td></tr>
<tr><td><code><strike></code></td><td>replaced by <code><s></code> or <code><del></code></td></tr>
<tr><td><code><tt></code></td><td>replaced by <code><code></code> or CSS</td></tr>
<tr><td><code><xmp></code></td><td>replaced by <code><pre></code>/<code><code></code></td></tr>
</tbody>
</table>
</section>
<div id="no-results">No tags match your search.</div>
</main>